/*
Theme Name: Ag Communication
Theme URI: https://agcommunication.net/
Author: Ag Communication
Author URI: https://agcommunication.net/
Description: Custom WordPress theme for Ag Communication, a District Internet Service Provider. The theme owns the header and footer (Customizer + widgets); all page content is built with Elementor.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: agcommunication
Tags: custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, elementor
*/

/* ==========================================================================
   This file is the WordPress integration layer ONLY.

   The design system lives in css/styles.css and is loaded BEFORE this file.
   Everything below maps WordPress / Elementor / Contact Form 7 markup onto
   the classes that css/styles.css already defines. Do not restyle the design
   system here.
   ========================================================================== */

/* ==========================================================================
   1. WordPress core required classes
   ========================================================================== */
.screen-reader-text {
    border: 0;
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    clip-path: none;
    color: var(--color-primary);
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    height: auto;
    left: 6px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 6px;
    width: auto;
    z-index: 100000;
}

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

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

.aligncenter {
    clear: both;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5em;
}

.alignwide { max-width: 1100px; }
.alignfull { max-width: none; }

.wp-caption {
    margin-bottom: 1.5em;
    max-width: 100%;
}

.wp-caption img[class*="wp-image-"] {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.6em 0;
    text-align: center;
}

.sticky { display: block; }
.bypostauthor { display: block; }

.gallery {
    display: grid;
    grid-template-columns: repeat(var(--gallery-cols, 3), 1fr);
    gap: 16px;
    margin-bottom: 1.5em;
}

.gallery-columns-1 { --gallery-cols: 1; }
.gallery-columns-2 { --gallery-cols: 2; }
.gallery-columns-4 { --gallery-cols: 4; }
.gallery-columns-5 { --gallery-cols: 5; }
.gallery-columns-6 { --gallery-cols: 6; }

.gallery-item img {
    border-radius: var(--radius-sm);
    display: block;
    width: 100%;
    height: auto;
}

/* Admin bar must not hide the fixed header */
.admin-bar .header { top: 32px; }
.admin-bar .mobile-nav-overlay { top: 102px; height: calc(100vh - 102px); }

@media screen and (max-width: 782px) {
    .admin-bar .header { top: 46px; }
    .admin-bar .mobile-nav-overlay { top: 116px; height: calc(100vh - 116px); }
}

/* ==========================================================================
   2. Navigation menus
   css/styles.css styles bare <a class="nav-link">. WordPress wraps those in
   <ul><li>, so the lists are flattened back into the original flex row here.
   ========================================================================== */
.nav-links ul,
.mobile-nav-overlay ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links > ul {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links > ul > li {
    position: relative;
    display: flex;
    align-items: center;
}

/* --- Dropdown submenus (not present in the static HTML, added for WP) --- */
.nav-links ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: 10px 0;
    margin-top: 12px;
    background-color: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    z-index: 1001;
}

.nav-links ul ul ul {
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 6px;
}

.nav-links li:hover > ul,
.nav-links li:focus-within > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.nav-links ul ul .nav-link {
    display: block;
    width: 100%;
    padding: 9px 18px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* The animated underline is for the top row only */
.nav-links ul ul .nav-link::after { display: none; }

.nav-links ul ul .nav-link:hover {
    background-color: var(--bg-tertiary);
}

/* Parent items that have children get a caret */
.nav-links > ul > li.menu-item-has-children > .nav-link::before {
    content: "";
    position: absolute;
    right: -14px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    opacity: 0.6;
}

.nav-links > ul > li.menu-item-has-children { margin-right: 10px; }

/* --- Mobile drawer: submenus are flattened and indented --- */
.mobile-nav-overlay > ul {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
}

.mobile-nav-overlay > ul li { width: 100%; }

/* css/styles.css gives the drawer links width:100% and text-align:center, but
   WordPress nests them in <li> where an inline <a> ignores both. */
.mobile-nav-overlay ul .nav-link {
    display: block;
    width: 100%;
}

.mobile-nav-overlay ul ul .nav-link {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.85;
}

/* Indent submenu items instead of centring them, so hierarchy stays readable. */
.mobile-nav-overlay ul ul {
    padding-left: 0;
}

.mobile-nav-overlay ul ul .nav-link {
    text-align: center;
}

/* ==========================================================================
   3. Footer widget areas
   Core widgets are mapped onto the .footer-col / .footer-links look.
   ========================================================================== */
.footer-col .widget { margin-bottom: 32px; }
.footer-col .widget:last-child { margin-bottom: 0; }

.footer-col .widget-title,
.footer-col .widgettitle {
    color: #ffffff;
    font-size: 1.25rem;
    font-family: var(--font-accent);
    margin-bottom: 24px;
    position: relative;
}

.footer-col .widget-title::after,
.footer-col .widgettitle::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--color-primary);
}

/* Any list-producing core widget (Navigation Menu, Pages, Categories,
   Recent Posts, Archives) inherits the .footer-links treatment. */
.footer-col .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col .widget ul li { margin-bottom: 12px; }

.footer-col .widget ul a {
    color: #9ca3af;
    font-size: 0.95rem;
    transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.footer-col .widget ul a:hover {
    color: #ffffff;
    padding-left: 5px;
}

.footer-col .widget ul ul {
    margin-top: 12px;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-col .widget p {
    color: #9ca3af;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.footer-col .widget select,
.footer-col .widget input[type="search"],
.footer-col .widget input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: #e5e7eb;
}

/* ==========================================================================
   4. Blog sidebar + generic widget areas
   ========================================================================== */
.widget-area .widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.widget-area .widget-title {
    font-family: var(--font-accent);
    font-size: 1.15rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.widget-area .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget-area .widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget-area .widget ul li:last-child { border-bottom: none; }

.widget-area .widget a { color: var(--text-secondary); }
.widget-area .widget a:hover { color: var(--color-primary); }

/* ==========================================================================
   5. Contact Form 7
   CF7 emits plain <input>/<select>/<textarea>, so the .form-control look is
   applied by element. Keeps the Support ticket form identical to the mockup.
   ========================================================================== */
.wpcf7 .wpcf7-form-control-wrap { display: block; }

.wpcf7 label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 select,
.wpcf7 textarea {
    width: 100%;
    padding: 12px 18px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
    background-color: var(--bg-primary);
}

.wpcf7 textarea { resize: vertical; min-height: 120px; }

.wpcf7 .form-group { margin-bottom: 24px; }

/* CF7's autop wraps each group in <p> and puts a <br> after the label,
   which adds a blank line between label and field. */
.wpcf7 .form-group p { margin: 0; }
.wpcf7 .form-group br { display: none; }

/* Submit button reuses .btn .btn-primary from css/styles.css */
.wpcf7 input[type="submit"] {
    width: 100%;
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
}

/* Spinner alignment */
.wpcf7 .wpcf7-spinner {
    display: block;
    margin: 12px auto 0;
}

/* Validation + response messages */
.wpcf7 .wpcf7-not-valid-tip {
    color: var(--color-danger);
    font-size: 0.82rem;
    margin-top: 6px;
}

.wpcf7 input.wpcf7-not-valid,
.wpcf7 select.wpcf7-not-valid,
.wpcf7 textarea.wpcf7-not-valid {
    border-color: var(--color-danger);
}

.wpcf7 form .wpcf7-response-output {
    margin: 20px 0 0;
    padding: 14px 18px;
    border-width: 1px;
    border-style: solid;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.wpcf7 form.sent .wpcf7-response-output {
    border-color: var(--color-success);
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-success);
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output {
    border-color: var(--color-warning);
    background-color: rgba(245, 158, 11, 0.08);
    color: var(--color-warning);
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output {
    border-color: var(--color-danger);
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--color-danger);
}

/* ==========================================================================
   6. Blog / archive / comments
   ========================================================================== */
.site-main-wrapper {
    padding-top: 140px;
    padding-bottom: 100px;
    min-height: 60vh;
}

.content-sidebar-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    align-items: start;
}

.entry-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 32px;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.entry-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.entry-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.entry-body { padding: 28px; }

.entry-title {
    font-family: var(--font-accent);
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.entry-title a { color: inherit; }
.entry-title a:hover { color: var(--color-primary); }

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.entry-content > * + * { margin-top: 1.1em; }

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: var(--font-accent);
    margin-top: 1.6em;
}

.entry-content ul,
.entry-content ol { padding-left: 1.4em; }

.entry-content li { margin-bottom: 0.5em; }

.entry-content blockquote {
    border-left: 3px solid var(--color-primary);
    padding-left: 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.entry-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

.entry-content a { color: var(--color-primary); text-decoration: underline; }

.post-navigation,
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 40px;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--bg-primary);
}

.comments-area {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.comments-title,
.comment-reply-title {
    font-family: var(--font-accent);
    font-size: 1.5rem;
    margin-bottom: 28px;
}

.comment-list,
.comment-list .children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .children { padding-left: 32px; margin-top: 24px; }

.comment-body {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-weight: 600;
}

.comment-author img { border-radius: 50%; }

.comment-metadata { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 12px; }

.comment-form .form-group { margin-bottom: 20px; }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 18px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

/* ==========================================================================
   7. Elementor interoperability
   ========================================================================== */
/* Elementor full-width/canvas pages must clear the fixed header */
.elementor-template-full-width .site-content,
body.elementor-page .site-content { padding-top: 0; }

/* Keep Elementor containers from fighting the theme .container width */
.elementor-section.elementor-section-boxed > .elementor-container { max-width: 1280px; }

/* Editor preview: the fixed header would overlap the canvas */
body.elementor-editor-active .header { position: absolute; }

/* ==========================================================================
   8. Custom Elementor widget components

   These rules were inline <style> blocks in the original per-page HTML
   (mainly ftp-servers.html). They belong to the custom widgets, so they move
   here rather than into the design system.
   ========================================================================== */

/* --- AG FTP Server Grid --- */
.ftp-search-wrapper {
    max-width: 600px;
    margin: 0 auto 40px auto;
    position: relative;
    z-index: 2;
}

.ftp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 2;
}

.ftp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.ftp-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    border-color: var(--border-glow);
}

.ftp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.ftp-title-area h3 {
    font-size: 1.35rem;
    margin-bottom: 4px;
}

.ftp-category {
    font-size: 0.75rem;
    background-color: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-dot.maintenance {
    background-color: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
}

.status-dot.offline {
    background-color: var(--color-danger);
}

.ftp-details {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 0.85rem;
}

.ftp-detail-label { color: var(--text-secondary); }

.ftp-detail-val {
    font-weight: 600;
    text-align: right;
}

/* --- AG Package Grid --- */
/* .packages-grid, .package-card and .package-tabs come from css/styles.css.
   Only the widget wrapper needs a rule. */
.packages-widget .package-tabs { margin-bottom: 40px; }

/* --- AG Speed Recommender --- */
/* Reuses .slider-container, .range-slider and .slider-rec from
   css/styles.css; nothing extra is required. */

/* --- AG Numbered Features ---
   Replaces the inline styles the static about.html used for this card. */
.agcom-numbered-features {
    padding: 40px;
    border-radius: var(--radius-md);
}

.agcom-nf--glow { border-color: var(--border-glow); }

.agcom-nf-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
    font-family: var(--font-accent);
}

.agcom-nf-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.agcom-nf-item {
    display: flex;
    gap: 16px;
}

.agcom-nf-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.agcom-nf-badge--primary   { background: rgba(0, 240, 255, 0.1);  color: var(--color-primary); }
.agcom-nf-badge--secondary { background: rgba(189, 0, 255, 0.1);  color: var(--color-secondary); }
.agcom-nf-badge--accent    { background: rgba(6, 182, 212, 0.1);  color: var(--color-accent); }
.agcom-nf-badge--success   { background: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.agcom-nf-badge--warning   { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }

/* The light theme needs a touch more tint to stay visible. */
[data-theme="light"] .agcom-nf-badge--primary   { background: rgba(2, 132, 199, 0.12); }
[data-theme="light"] .agcom-nf-badge--secondary { background: rgba(124, 58, 237, 0.12); }

.agcom-nf-body h4 {
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.agcom-nf-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* --- AG Feature Cards ---
   css/styles.css targets `.feature-card h3`; the widget lets the tag be
   changed, so the class carries the same styling for any tag. */
.feature-card .feature-title {
    font-size: 1.35rem;
    margin-bottom: 12px;
}

/* Elementor's icon control may emit <i> or <svg>. Its Font Awesome SVGs are
   solid-path (fill based); the hand-written SVGs in the original markup are
   stroke based. Forcing one style onto the other makes the icon disappear. */
.feature-icon-wrapper svg {
    width: 26px;
    height: 26px;
}

.feature-icon-wrapper .e-font-icon-svg {
    fill: currentColor;
    stroke: none;
}

.feature-icon-wrapper svg:not(.e-font-icon-svg) {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.feature-icon-wrapper i { font-size: 1.6rem; line-height: 1; }

/* The call-to-action line under a service card (Services page). */
.feature-card .feature-link {
    display: inline-block;
    margin-top: 15px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* .gradient-text clips the background to the text, so the usual hover colour
   change does nothing; shift the gradient instead. */
a.feature-link:hover { background-position: right center; }

/* --- AG Stats Strip ---
   The widget sits inside an Elementor section, which already provides the
   page gutter, so the inner .container must not add a second one. */
.elementor-widget-agcom_stats_strip .stats-strip { margin: 0; }
.elementor-widget-agcom_stats_strip .stats-strip > .container { padding: 0; }

/* --- Value cards (About page) ---
   Built from stock Elementor columns; this only supplies the glass panel
   look the static markup applied inline. */
.agcom-value-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.agcom-value-card .elementor-heading-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.agcom-value-card p { font-size: 0.9rem; color: var(--text-secondary); }

/* --- Two-column panel used by the About page --- */
.agcom-coverage-panel { align-items: flex-start; }

/* The static markup spaced these paragraphs inline; the global reset zeroes
   margins, so the rhythm has to be restored here. */
.agcom-vision-title .elementor-heading-title { margin-bottom: 20px; }

.agcom-vision-text p + p { margin-top: 20px; }

.agcom-vision-text { margin-bottom: 30px; }

/* --- Support page: Diagnostics + Ticket glass panels ---
   Two stock columns. The column keeps Elementor's gutter; the widget wrap
   inside it is the visible panel, so the panels stay apart when stacked. */
.agcom-support-panels > .elementor-container { align-items: flex-start; }

.agcom-glass-panel > .elementor-widget-wrap.elementor-element-populated {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px;
}

.agcom-glass-panel:first-child { padding-right: 25px; }
.agcom-glass-panel:last-child { padding-left: 25px; }

.elementor-widget.agcom-panel-title .elementor-heading-title {
    font-family: var(--font-accent);
    font-size: 1.6rem;
    color: var(--text-primary);
}

.agcom-panel-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.agcom-diagnostics .btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 20px;
}

.agcom-diagnostics .btn:disabled { opacity: 0.6; cursor: wait; }

.agcom-diagnostic-console {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    min-height: 180px;
    overflow-y: auto;
    line-height: 1.8;
}

.agcom-glass-panel .wpcf7 input[type="submit"] {
    width: 100%;
    justify-content: center;
}

@media (max-width: 767px) {
    .agcom-glass-panel:first-child,
    .agcom-glass-panel:last-child { padding: 0; }

    .agcom-glass-panel:first-child { margin-bottom: 30px; }

    .agcom-glass-panel > .elementor-widget-wrap.elementor-element-populated { padding: 28px; }
}

/* --- FAQ: stock Accordion dressed as the static .faq-item cards --- */
.agcom-faq .elementor-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.agcom-faq .elementor-accordion .elementor-accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow: hidden;
}

.agcom-faq .elementor-accordion .elementor-accordion-item + .elementor-accordion-item {
    border-top: 1px solid var(--border-color);
}

.agcom-faq .elementor-accordion .elementor-tab-title {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border: 0;
    transition: background-color var(--transition-fast);
}

.agcom-faq .elementor-accordion .elementor-tab-title:hover { background-color: var(--bg-secondary); }

.agcom-faq .elementor-accordion .elementor-accordion-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.agcom-faq.elementor-widget-accordion .elementor-accordion .elementor-tab-title.elementor-active a,
.agcom-faq.elementor-widget-accordion .elementor-accordion .elementor-tab-title.elementor-active .elementor-accordion-icon {
    color: var(--text-primary);
}

.agcom-faq .elementor-accordion .elementor-accordion-icon {
    float: none;
    width: auto;
    color: var(--text-primary);
    fill: currentColor;
}

.agcom-faq .elementor-accordion .elementor-accordion-icon svg {
    width: 0.9rem;
    height: 0.9rem;
    fill: currentColor;
}

.agcom-faq .elementor-accordion .elementor-tab-content {
    padding: 20px 24px 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.agcom-faq .elementor-tab-content a { font-weight: 600; }

@media (max-width: 991px) {
    .agcom-numbered-features { padding: 28px; }
}

/* ==========================================================================
   9. Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .content-sidebar-grid { grid-template-columns: 1fr; }
}

/* Must match the breakpoint in css/styles.css that hides .header .nav-links
   and reveals .mobile-nav-toggle (991px). A wider value here would leave a
   band where the menu is hidden but the hamburger has not appeared yet. */
@media (max-width: 991px) {
    .nav-links > ul { display: none; }
}

@media (max-width: 768px) {
    .site-main-wrapper { padding-top: 110px; padding-bottom: 60px; }
    .gallery { --gallery-cols: 2; }
    .comment-list .children { padding-left: 16px; }
}

/* --- AG Client Portal (demo) ---
   The first block is the <style> portal.html carried in its <head>; the rest
   replaces that page's inline styles. Layout (.portal-layout, sidebar, stat
   cards, usage bars) comes from css/styles.css. */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.login-card {
    max-width: 420px;
    width: 100%;
    margin: 100px auto;
    padding: 40px;
    border-radius: var(--radius-md);
}

.portal-section-view {
    display: none;
    animation: slide-up var(--transition-normal) forwards;
}

.portal-section-view.active { display: block; }

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-status.online {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
}

.badge-status.offline {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

/* Login screen */
.agcom-portal-login {
    padding-top: 150px;
    min-height: 80vh;
    position: relative;
}

.agcom-portal-login-title {
    font-size: 2rem;
    margin-bottom: 8px;
    font-family: var(--font-accent);
}

.agcom-portal-login-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.agcom-portal-login-form .form-group { text-align: left; }

.agcom-portal-login-form .btn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.agcom-portal-login-note {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Sidebar footer */
.agcom-portal .user-summary {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.user-summary-name { font-weight: 600; font-size: 0.95rem; }
.user-summary-id { font-size: 0.8rem; color: var(--text-muted); }

.agcom-portal-logout {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--color-danger);
    font-weight: 600;
}

/* Dashboard typography */
.agcom-portal-h2 { font-size: 2rem; font-family: var(--font-accent); }
.agcom-portal-h2.has-gap { font-size: 1.8rem; margin-bottom: 20px; }
.agcom-portal-h3 { font-size: 1.4rem; margin-bottom: 16px; font-family: var(--font-accent); }
.agcom-portal-h4 { font-size: 1.25rem; margin-bottom: 16px; font-family: var(--font-accent); }
.agcom-portal-h4.is-tight { font-size: 1.2rem; margin-bottom: 0; }

.agcom-portal-muted { color: var(--text-secondary); font-size: 0.95rem; }
.agcom-portal-muted.is-small { font-size: 0.85rem; }

.agcom-portal-welcome {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.portal-stat-label { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.portal-stat-val.is-plain { color: var(--text-primary); }
.portal-stat-val.is-secondary { color: var(--color-secondary); }
.portal-stat-val.is-success { color: var(--color-success); }

.portal-stat-note { font-size: 0.8rem; color: var(--text-muted); }
.portal-stat-note.is-primary { color: var(--color-primary); font-weight: 600; }
.portal-stat-note.is-success { color: var(--color-success); font-weight: 600; }

.agcom-portal-panel { padding: 24px; border-radius: var(--radius-md); }
.agcom-portal-panel.is-roomy { padding: 30px; }

.agcom-portal-metrics {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agcom-portal-metrics > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.agcom-portal-metrics > div:last-child { border-bottom: 0; }
.agcom-portal-metrics span { font-size: 0.9rem; color: var(--text-secondary); }
.agcom-portal-metrics em { font-style: normal; }
.agcom-portal-metrics .is-success { color: var(--color-success); }

/* Billing */
.agcom-portal-cycle,
.agcom-portal-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.agcom-portal-eyebrow {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.agcom-portal-cycle-status {
    font-size: 2.2rem;
    font-family: var(--font-accent);
    font-weight: 700;
    color: var(--color-success);
    margin-top: 4px;
}

.agcom-portal-cycle .agcom-portal-muted { font-size: 0.9rem; margin-top: 4px; }

.agcom-portal-pay-note {
    margin: -14px 0 30px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--color-success);
    font-size: 0.9rem;
}

.agcom-status { font-weight: 600; }
.agcom-status.is-paid { color: var(--color-success); }

.agcom-status.is-closed {
    color: var(--text-muted);
    background-color: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
}

/* The design system hides the sidebar below 1024px and leaves a note that
   mobile navigation "should be added". Show it as a scrolling tab row. */
@media (max-width: 1024px) {
    .agcom-portal .portal-sidebar {
        display: block;
        padding: 16px;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .agcom-portal .portal-menu {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .agcom-portal .portal-menu-item { white-space: nowrap; padding: 10px 14px; }

    .agcom-portal .user-summary {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
        margin-top: 12px;
        padding-top: 12px;
    }

    .agcom-portal .agcom-portal-logout { margin: 0 0 0 auto; }
}

@media (max-width: 640px) {
    .agcom-portal .portal-content { padding: 24px 16px; }
    .login-card { padding: 28px; margin: 40px auto; }
    .agcom-portal-login { padding-top: 120px; }
}
