/*
Theme Name: Interstate Security Service
Theme URI: https://interstatesecurityservice.com
Author: Interstate Security Service LLC
Author URI: https://interstatesecurityservice.com
Description: Premium, accessible, mobile-first security services theme with native visual page and theme builders, centralized design tokens, live-editing safeguards, service pages, forms, resources, and portal controls.
Version: 2.3.0
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 7.4
Text Domain: interstate-security
Domain Path: /languages
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: custom-logo, custom-menu, featured-images, translation-ready, wide-blocks
*/

/* 1. Design tokens and reset */
:root {
  --iss-ink: var(--wp--preset--color--ink, #080a09);
  --iss-surface: var(--wp--preset--color--surface, #101310);
  --iss-surface-raised: #171b18;
  --iss-gold: var(--wp--preset--color--brand-gold, #d5ad55);
  --iss-gold-bright: var(--wp--preset--color--bright-gold, #f0d58b);
  --iss-gold-dark: #9c7226;
  --iss-cream: var(--wp--preset--color--cream, #f4f0e7);
  --iss-text: #f7f4ec;
  --iss-muted: var(--wp--preset--color--muted, #aeb2ac);
  --iss-line: rgba(213, 173, 85, .22);
  --iss-white-line: rgba(255, 255, 255, .09);
  --iss-danger: #d56565;
  --iss-content: 1180px;
  --iss-radius: 2px;
  --iss-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  --iss-transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { width: 100%; max-width: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  width: 100%; max-width: 100%;
  background: var(--iss-ink);
  color: var(--iss-text);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.admin-bar .site-header { top: 32px; }
a { color: inherit; text-decoration: none; }
img, picture, svg, video, canvas { display: block; max-width: 100%; height: auto; }
iframe, embed, object { max-width: 100%; }
button, input, select, textarea { color: inherit; font: inherit; }
button { border-radius: 0; }
::selection { background: var(--iss-gold); color: var(--iss-ink); }

.container { width: min(var(--iss-content), calc(100% - clamp(28px, 4vw, 40px))); max-width: 100%; margin-inline: auto; }
.site-header, .site-footer, main, #main, .iss-builder-canvas { width: 100%; max-width: 100%; }
.nav-wrap, .primary-nav, .primary-nav ul, .actions, .section-head, .grid, .split, .stats, .cta,
.footer-grid, .legal, .form, .form-row, .content, .wp-block-group, .wp-block-columns,
.wp-block-column, .wp-block-cover, .wp-block-media-text, .wp-block-query, .wp-block-post-template {
  min-width: 0;
}
h1, h2, h3, h4, h5, h6, p, li, a, span, label, button {
  max-inline-size: 100%; overflow-wrap: break-word; word-break: normal; hyphens: manual;
}
.screen-reader-text, .skip-link {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed !important; z-index: 100000; top: 8px; left: 8px; width: auto; height: auto;
  clip: auto; padding: 12px 16px; background: #fff; color: #000; font-weight: 700;
}
:focus-visible { outline: 3px solid var(--iss-gold-bright); outline-offset: 3px; }

/* 2. Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0; color: inherit; font-family: "Playfair Display", Georgia, serif;
  font-weight: 700; line-height: 1.08; text-wrap: balance;
}
h1 { margin-block: 24px; font-size: clamp(2.25rem, 6vw, 5.75rem); letter-spacing: -.035em; }
h1 em { color: var(--iss-gold); font-style: normal; }
h2 { margin: 14px 0 20px; font-size: clamp(1.75rem, 4.5vw, 3.6rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.48rem); }
p { margin: 0 0 1.15em; }
.lead { max-width: 650px; color: #c9cdc6; font-size: clamp(1.05rem, 2vw, 1.18rem); }
.eyebrow {
  display: flex; align-items: center; gap: 9px; color: var(--iss-gold);
  font-size: .7rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
}
.eyebrow::before { width: 32px; height: 1px; background: currentColor; content: ""; }

/* 3. Header and navigation */
.topbar {
  padding: 7px 14px; background: var(--iss-gold); color: #111; text-align: center;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
}
.site-header { position: relative; z-index: 100; border-bottom: 1px solid var(--iss-line); background: rgba(8, 10, 9, .95); }
.nav-wrap { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 82px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-copy b { display: block; font-family: "Playfair Display", Georgia, serif; font-size: 1.05rem; line-height: 1.05; }
.brand-copy small { display: block; color: var(--iss-gold); font-size: .58rem; font-weight: 700; letter-spacing: .2em; }
.custom-logo { width: 54px; height: 58px; object-fit: contain; }
.badge {
  display: grid; flex: 0 0 auto; width: 49px; height: 57px; place-items: center;
  clip-path: polygon(50% 0, 92% 16%, 86% 70%, 50% 100%, 14% 70%, 8% 16%);
  background: linear-gradient(145deg, var(--iss-gold-bright), var(--iss-gold-dark));
  color: var(--iss-ink); filter: drop-shadow(0 4px 8px #000); font: 700 1rem "Playfair Display", Georgia, serif;
}
.primary-nav { display: flex; min-width: 0; align-items: center; gap: 20px; font-size: .82rem; }
.primary-nav ul { display: flex; align-items: center; gap: 24px; margin: 0; padding: 0; list-style: none; }
.primary-nav a { white-space: nowrap; transition: color var(--iss-transition); }
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--iss-gold); }
.header-actions-menu { gap: 9px !important; }
.header-actions-menu a {
  display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 14px;
  border: 1px solid var(--iss-gold); color: var(--iss-gold);
}
.header-actions-menu .iss-primary-action > a, .header-actions-menu > li:last-child > a { background: var(--iss-gold); color: var(--iss-ink); }
.iss-managed-navigation { position: relative; display: flex; flex: 1 1 auto; min-width: 0; align-items: center; justify-content: flex-end; }
.iss-languages ul { display: flex; gap: 8px; }
.iss-languages a { padding: 3px 6px; border: 1px solid var(--iss-line); font-size: .68rem; }
.iss-languages a[aria-current="page"] { background: var(--iss-gold); color: var(--iss-ink); }
.menu-toggle { display: none; width: 42px; padding: 6px; border: 0; background: transparent; cursor: pointer; }
.menu-toggle span:not(.screen-reader-text) { display: block; height: 2px; margin: 6px; background: #fff; }

/* 4. Buttons and interactive controls */
.button, button.button, input[type="submit"] {
  display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 19px; border: 1px solid var(--iss-gold); border-radius: var(--iss-radius);
  background: var(--iss-gold); color: var(--iss-ink) !important; cursor: pointer;
  font-size: .82rem; font-weight: 700; line-height: 1.2; transition: background var(--iss-transition), transform var(--iss-transition), box-shadow var(--iss-transition);
}
.button:hover { background: var(--iss-gold-bright); box-shadow: 0 10px 25px rgba(213, 173, 85, .16); transform: translateY(-2px); }
.button.outline { background: transparent; color: var(--iss-gold) !important; }
.button.dark { border-color: var(--iss-ink); background: var(--iss-ink); color: #fff !important; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* 5. Hero surfaces */
.hero {
  position: relative; display: grid; min-height: 700px; align-items: center;
  background: radial-gradient(circle at 75% 40%, rgba(213,173,85,.17), transparent 32%),
    linear-gradient(90deg, #080a09 45%, rgba(8,10,9,.76)),
    repeating-linear-gradient(90deg, transparent 0 49px, rgba(213,173,85,.045) 50px);
}
.hero::after {
  position: absolute; top: 15%; right: 6%; width: 380px; height: 480px; border: 1px solid var(--iss-line);
  background: linear-gradient(145deg, transparent, rgba(213,173,85,.055)); content: ""; transform: skew(-8deg);
}
.hero-copy { position: relative; z-index: 2; width: 100%; max-width: 760px; padding-block: 90px; }
.page-hero {
  padding-block: 95px 75px; border-bottom: 1px solid var(--iss-line);
  background: radial-gradient(circle at 80%, rgba(213,173,85,.13), transparent 30%);
}
.page-hero h1 { font-size: clamp(2.75rem, 6vw, 4.5rem); }
.breadcrumbs { margin-bottom: 28px; color: var(--iss-muted); font-size: .75rem; }
.breadcrumbs a:hover { color: var(--iss-gold); }

/* 6. Layout primitives */
.section { padding-block: 100px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 45px; }
.section-head > p { max-width: 480px; color: var(--iss-muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 70px; }
.light { background: var(--iss-cream); color: #111; }
.light p { color: #555b56; }
.light .eyebrow, .light .more, .light a:not(.button) { color: #77530f; }
.content { max-width: 800px; }
.content h2 { margin-top: 40px; font-size: clamp(1.9rem, 4vw, 2.3rem); }
.content h3 { margin-top: 28px; }
.content p, .content li { color: #bdc1bb; }
.content a { color: var(--iss-gold-bright); text-decoration: underline; text-underline-offset: 3px; }
.content img { margin-block: 25px; }
.alignwide { width: min(100%, 1380px); max-width: 100%; margin-inline: auto; transform: none; }
.alignfull { width: 100%; max-width: 100%; margin-inline: 0; }

/* 7. Cards, statistics, checks, and AI modules */
.stats {
  position: relative; z-index: 4; display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: -48px; border: 1px solid var(--iss-line); background: #0d100e; box-shadow: var(--iss-shadow);
}
.stat { padding: 28px; border-right: 1px solid var(--iss-line); }
.stat:last-child { border: 0; }
.stat strong { display: block; color: var(--iss-gold); font: 700 1.6rem "Playfair Display", Georgia, serif; }
.stat span { color: var(--iss-muted); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.card {
  display: block; min-height: 250px; padding: 28px; border: 1px solid var(--iss-white-line);
  background: var(--iss-surface); transition: border-color var(--iss-transition), transform var(--iss-transition), box-shadow var(--iss-transition);
}
.card:hover { border-color: var(--iss-gold); box-shadow: var(--iss-shadow); transform: translateY(-4px); }
.card .icon { margin-bottom: 35px; color: var(--iss-gold); font-size: 1.55rem; }
.card p { color: var(--iss-muted); font-size: .88rem; }
.more { color: var(--iss-gold); font-size: .72rem; font-weight: 700; letter-spacing: .03em; }
.visual {
  display: grid; min-height: 480px; place-items: center; border: 1px solid var(--iss-line);
  background: linear-gradient(145deg, #1b211d, #080a09); box-shadow: var(--iss-shadow);
}
.visual .badge { width: 180px; height: 210px; font-size: 2.8rem; }
.checks { display: grid; gap: 16px; margin-block: 28px; }
.check { display: flex; align-items: flex-start; gap: 12px; }
.check i { color: var(--iss-gold); font-style: normal; font-weight: 700; }
.ai-panel {
  padding: clamp(28px, 4vw, 38px); border: 1px solid var(--iss-line);
  background: linear-gradient(135deg, #151a16, #080a09); box-shadow: var(--iss-shadow);
}
.ai-panel h3 { margin-top: 22px; }
.ai-panel label { display: block; margin-block: 18px; color: #d3d6ce; font-size: .78rem; font-weight: 700; }
.ai-panel select { width: 100%; margin-top: 7px; padding: 13px; border: 1px solid #3a3f3a; background: #151815; }
.ai-tag { display: inline-flex; padding: 4px 8px; border: 1px solid var(--iss-gold); color: var(--iss-gold); font-size: .62rem; letter-spacing: .16em; }
.notice { margin-top: 18px; padding-left: 12px; border-left: 2px solid var(--iss-gold); color: var(--iss-muted); font-size: .76rem; }

/* 8. Forms */
.form { display: grid; gap: 15px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form label { color: #d0d3cc; font-size: .76rem; font-weight: 700; }
.form input, .form select, .form textarea {
  width: 100%; margin-top: 6px; padding: 13px; border: 1px solid #3a3e3a; border-radius: 0;
  background: #151815; color: #fff; outline: none; transition: border-color var(--iss-transition), box-shadow var(--iss-transition);
}
.form textarea { min-height: 130px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--iss-gold); box-shadow: 0 0 0 3px rgba(213,173,85,.12); }
.form-message { margin-bottom: 20px; padding: 15px; border: 1px solid var(--iss-gold); background: rgba(213,173,85,.07); }
.iss-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.iss-search-form { display: flex; gap: 10px; margin-block: 25px 40px; }
.iss-search-form label { flex: 1; }
.iss-search-form input { width: 100%; min-height: 46px; padding: 12px 14px; border: 1px solid #3a3e3a; background: #151815; color: #fff; }
.search-result { padding-block: 28px; border-bottom: 1px solid var(--iss-white-line); }
.iss-responsive-embed { position: relative; width: 100%; overflow: hidden; aspect-ratio: 16 / 9; background: #000; }
.iss-responsive-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* 9. CTA, portal, and footer */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: clamp(30px, 4.5vw, 55px); background: var(--iss-gold); color: #111; }
.cta h2 { font-size: clamp(2rem, 4vw, 2.6rem); }
.portal-box { max-width: 720px; margin-inline: auto; padding: clamp(35px, 6vw, 60px); text-align: center; }
.portal-lock { color: var(--iss-gold); font-size: 3.25rem; }
.site-footer { padding-block: 65px 30px; background: #050605; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.footer-grid h3 { margin-bottom: 16px; color: var(--iss-gold); font: 700 .72rem "DM Sans", sans-serif; letter-spacing: .14em; }
.footer-grid a { display: block; margin-block: 9px; color: #a4a8a2; font-size: .82rem; }
.footer-grid a:hover { color: var(--iss-gold-bright); }
.footer-grid p { max-width: 330px; color: #969a94; font-size: .82rem; }
.footer-menu { margin: 0; padding: 0; list-style: none; }
.legal { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid #202320; color: #81847f; font-size: .72rem; }

/* 10. WordPress-native content */
.wp-caption, .gallery-caption { max-width: 100%; color: var(--iss-muted); font-size: .8rem; }
.wp-caption-text { margin-top: 8px; }
.sticky { border-color: var(--iss-gold); }
.bypostauthor { position: relative; }
.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 35px; }
.page-numbers { padding: 8px 12px; border: 1px solid var(--iss-line); }
.page-numbers.current { background: var(--iss-gold); color: var(--iss-ink); }
.comment-list { padding: 0; list-style: none; }
.comment-list .comment { margin-block: 20px; padding: 20px; border: 1px solid var(--iss-white-line); }
.comment-meta { color: var(--iss-muted); font-size: .8rem; }
.comment-form { display: grid; gap: 14px; }
.comment-form input, .comment-form textarea { width: 100%; padding: 12px; border: 1px solid #3a3e3a; background: #151815; color: #fff; }

/* 10.1 Frame-safe media and block layouts */
figure, .wp-caption, .wp-block-image, .wp-block-gallery, .wp-block-video, .wp-block-audio,
.wp-block-embed, .wp-block-post-featured-image { width: auto; max-width: 100%; }
.wp-block-image img, .wp-block-gallery img, .wp-block-video video, .wp-block-post-featured-image img,
.woocommerce img, .custom-logo { max-width: 100%; height: auto; object-fit: contain; object-position: center; }
.wp-block-cover { height: auto; max-width: 100%; overflow: visible; }
.wp-block-cover .wp-block-cover__image-background,
.wp-block-cover .wp-block-cover__video-background {
  width: 100%; height: 100%; max-width: 100%; object-fit: contain !important; object-position: center !important;
}
.wp-block-cover__inner-container, .wp-block-media-text__content, .wp-block-media-text__media,
.wp-block-navigation, .wp-block-navigation__container { min-width: 0; max-width: 100%; }
.wp-block-media-text__media img, .wp-block-media-text__media video { width: 100%; height: auto; object-fit: contain; }
.wp-block-embed__wrapper { max-width: 100%; }
.wp-block-embed__wrapper iframe, .iss-responsive-embed iframe { max-width: 100%; }
.wp-block-table { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wp-block-table table, table { width: 100%; max-width: 100%; }
.wp-block-button, .wp-block-button__link, .button, button.button, input[type="submit"] { max-width: 100%; white-space: normal; }
.wp-block-search, .wp-block-search__inside-wrapper, .wp-block-search__input { min-width: 0; max-width: 100%; }
.wp-block-columns, .wp-block-post-template.is-layout-grid { max-width: 100%; }
.wp-block-column > *, .grid > *, .split > *, .footer-grid > *, .stats > * { max-width: 100%; }
.wp-block-buttons { max-width: 100%; flex-wrap: wrap; }
.wp-block-button { min-width: 0; flex: 0 1 auto; }
.page-editable-content, .page-editable-summary { width: 100%; min-width: 0; max-width: 100%; }

/* 11. Responsive behavior */
@media (max-width: 1120px) {
  .menu-toggle { display: block; }
  .primary-nav {
    position: absolute; top: 82px; right: 0; left: 0; display: none; align-items: stretch;
    width: 100%; max-width: 100%; max-height: calc(100vh - 110px); overflow-y: auto;
    padding: 22px; border: 1px solid var(--iss-line); background: #0d0f0d; box-shadow: var(--iss-shadow); flex-direction: column;
  }
  .primary-nav.open { display: flex; }
  .primary-nav ul { width: 100%; align-items: stretch; gap: 10px; flex-direction: column; }
  .primary-nav a { width: 100%; white-space: normal; }
  .header-actions-menu a { min-height: 46px; }
  .iss-managed-navigation { flex: 0 0 auto; }
  .iss-managed-navigation .primary-nav { top: calc(100% + 12px); right: 0; left: auto; width: min(92vw, 520px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .split { grid-template-columns: 1fr; gap: 45px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head { display: block; }
  .cta { display: block; }
  .cta .button { margin-top: 15px; }
  .hero::after {
    display: block; top: auto; right: 4%; bottom: 7%; width: min(34vw, 280px); height: min(44vw, 360px);
    opacity: .35; transform: none;
  }
  h1 { font-size: clamp(2.35rem, 6.5vw, 4.5rem); }
  h2 { font-size: clamp(1.85rem, 4.5vw, 3rem); }
}

@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
  h1 { font-size: clamp(2.15rem, 9vw, 3.25rem); letter-spacing: -.025em; text-wrap: pretty; }
  h2 { font-size: clamp(1.65rem, 7vw, 2.5rem); text-wrap: pretty; }
  .wp-block-columns:not(.is-not-stacked-on-mobile) { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column { width: 100%; min-width: 0; flex-basis: auto !important; }
  .wp-block-media-text.is-stacked-on-mobile { grid-template-columns: minmax(0, 1fr) !important; }
  .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media,
  .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content { grid-column: 1; }
  .wp-block-group.is-layout-flex { flex-wrap: wrap; }
}

@media (max-width: 600px) {
  .container { width: min(100% - 28px, var(--iss-content)); }
  .topbar { font-size: .62rem; letter-spacing: .045em; }
  .brand-copy b { font-size: .86rem; }
  .section { padding-block: 70px; }
  .grid, .form-row { grid-template-columns: minmax(0, 1fr); }
  .wp-block-post-template.is-layout-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
  .stat { padding: 20px; }
  .stat:nth-child(2) { border-right: 0; }
  .hero { min-height: 620px; }
  .hero-copy { padding-block: 60px; }
  .page-hero { padding-block: 70px 55px; }
  .footer-grid { grid-template-columns: 1fr; }
  .legal { display: block; }
  .legal span { display: block; margin-top: 7px; }
  .visual { min-height: 340px; }
  .cta { padding: 34px 24px; }
  .wp-block-group.alignfull, .wp-block-cover.alignfull { padding-inline: clamp(14px, 5vw, 24px) !important; }
  .wp-block-columns, .wp-block-media-text { gap: 24px; }
  .wp-block-buttons, .actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .wp-block-button, .wp-block-button__link, .actions .button { width: 100%; }
}

@media (max-width: 440px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat { border-right: 0; border-bottom: 1px solid var(--iss-line); }
  .stat:last-child { border-bottom: 0; }
  .brand-copy small { letter-spacing: .12em; }
  .custom-logo { width: 46px; height: 50px; }
  .hero { min-height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .topbar, .site-header, .cta, .site-footer, .button, .menu-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section, .page-hero { padding-block: 20px; }
  a { color: #000; text-decoration: underline; }
}
