/* ==========================================================================
   JohnDavid IT — main stylesheet
   Structure: tokens > base > layout > components (header, hero, services,
   management, packages, seo, faq, about, contact) > footer > media queries
   ========================================================================== */

:root {
    --ink: #1c2321;
    --ink-muted: #5a655f;
    --paper: #faf9f6;
    --surface: #ffffff;
    --border: #e3e1da;
    --accent: #1d4f8f;        /* navy from logo */
    --accent-ink: #ffffff;
    --accent-soft: #eaf0f7;
    --max: 1080px;
    --radius: 8px;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html { scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none; transition: none; }
  }

  body {
    font-family: "Avenir Next", "Segoe UI", -apple-system, sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    font-size: 17px;
  }

  h1, h2, h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 600;
    line-height: 1.15;
    text-wrap: pretty;
  }

  a { color: var(--accent); }

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

  /* ---------- Header ---------- */
  header {
    border-bottom: 1px solid var(--border);
    background: var(--paper);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    max-width: var(--max);
    margin: 0 auto;
  }
  .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.01em;
  }
  .logo span { color: #2278c9; }
  .logo img { height: 52px; width: auto; display: block; }

  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 10px 18px;
    border-radius: 0 0 var(--radius) 0;
    z-index: 100;
  }
  .skip-link:focus {
    left: 0;
  }
  nav ul {
    display: flex;
    gap: 28px;
    list-style: none;
  }
  nav a {
    text-decoration: none;
    color: var(--ink-muted);
    font-size: 0.95rem;
    padding: 8px 2px;
  }
  nav a:hover, nav a:focus-visible { color: var(--ink); }
  nav a.nav-cta {
    background: var(--accent);
    color: var(--accent-ink);
    padding: 10px 18px;
    border-radius: var(--radius);
    font-weight: 600;
  }
  .nav-cta:hover { background: #16406f; }

  /* ---------- Hero ---------- */
  .hero {
    padding: 88px 0 72px;
    position: relative;
    isolation: isolate;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  /* Readability overlay: only visible when a background image is set (hero gets .has-bg) */
  .hero.has-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(250, 249, 246, 0.82);   /* frost the image so text stays readable */
    z-index: -1;
  }
  .hero .wrap {
    max-width: 780px;
  }
  .hero-slides { position: relative; }
  .hero-slide {
    display: none;
  }
  .hero-slide.active {
    display: block;
    animation: heroFade 0.5s ease;
  }
  @keyframes heroFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
  .hero-dots {
    display: flex;
    gap: 10px;
    margin-top: 40px;
  }
  .hero-dots button {
    width: 34px;
    height: 6px;
    border-radius: 3px;
    border: none;
    background: var(--border);
    cursor: pointer;
    padding: 0;
    transition: background 0.25s ease;
  }
  .hero-dots button.active { background: var(--accent); }
  .hero-dots button:hover { background: #b9c6d8; }
  .hero-dots button.active:hover { background: var(--accent); }
  .hero .kicker {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 16px;
  }
  .hero h1,
  .hero .hero-title {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 600;
    line-height: 1.15;
    text-wrap: pretty;
    font-size: clamp(2rem, 5vw, 3.1rem);
    margin-bottom: 20px;
  }
  .hero p.lede {
    font-size: 1.2rem;
    color: var(--ink-muted);
    max-width: 56ch;
    margin-bottom: 32px;
  }
  .btn {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    font-weight: 600;
    padding: 14px 26px;
    border-radius: var(--radius);
    min-height: 44px;
  }
  .btn:hover, .btn:focus-visible { background: #16406f; }
  .btn.secondary {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    margin-left: 12px;
  }
  .btn.secondary:hover { background: var(--accent-soft); }

  /* ---------- Sections ---------- */
  section { padding: 72px 0; }
  section h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 12px;
  }
  .section-intro {
    color: var(--ink-muted);
    max-width: 60ch;
    margin-bottom: 40px;
  }

  /* ---------- Services (definition list, not icon cards) ---------- */
  #services { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .services-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 56px;
  }
  .service {
    padding: 26px 0;
    border-top: 1px solid var(--border);
  }
  .service h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
  }
  .service p {
    color: var(--ink-muted);
    font-size: 0.97rem;
  }

  .service-groups {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  .service-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 26px;
    background: var(--paper);
  }
  .service-group h3 {
    font-size: 1.2rem;
    margin-bottom: 2px;
  }
  .service-group .sg-sub {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
  }
  .service-group ul { list-style: none; }
  .service-group li {
    padding: 7px 0 7px 24px;
    position: relative;
    font-size: 0.94rem;
    color: var(--ink-muted);
    border-bottom: 1px solid var(--border);
  }
  .service-group li:last-child { border-bottom: none; }
  .service-group li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
  }

  /* ---------- SEO & online presence ---------- */
  #faq {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .seo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 56px;
  }
  .seo-item {
    padding: 26px 0;
    border-top: 1px solid var(--border);
  }
  .seo-item h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }
  .seo-item p {
    color: var(--ink-muted);
    font-size: 0.95rem;
  }

  /* ---------- FAQ ---------- */
  .faq-list {
    max-width: 760px;
  }
  .faq-list details {
    border-bottom: 1px solid var(--border);
  }
  .faq-list details:first-of-type {
    border-top: 1px solid var(--border);
  }
  .faq-list summary {
    cursor: pointer;
    padding: 18px 36px 18px 0;
    font-weight: 600;
    font-size: 1.02rem;
    list-style: none;
    position: relative;
    min-height: 44px;
  }
  .faq-list summary::-webkit-details-marker { display: none; }
  .faq-list summary::after {
    content: "+";
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--accent);
    transition: transform 0.2s ease;
  }
  .faq-list details[open] summary::after {
    content: "−";
  }
  .faq-list summary:hover { color: var(--accent); }
  .faq-list .faq-a {
    padding: 0 0 20px;
    color: var(--ink-muted);
    font-size: 0.97rem;
    max-width: 65ch;
  }

  /* ---------- About ---------- */
  /* ---------- Website Management / Packages ---------- */
  #management { padding-bottom: 48px; }
  .before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 40px 0 8px;
  }
  .ba-col {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    background: var(--surface);
  }
  .ba-col.after { border-color: var(--accent); background: var(--accent-soft); }
  .ba-col h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
  }
  .ba-col .ba-sub {
    font-size: 0.85rem;
    color: var(--ink-muted);
    margin-bottom: 14px;
  }
  .ba-col ul { list-style: none; }
  .ba-col li {
    padding: 6px 0 6px 26px;
    position: relative;
    font-size: 0.94rem;
  }
  .ba-col.before li::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: #b3543f;
    font-weight: 700;
  }
  .ba-col.after li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
  }
  .mgmt-points {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 40px;
    list-style: none;
    max-width: 720px;
    margin-bottom: 8px;
  }
  .mgmt-points li {
    padding: 6px 0 6px 26px;
    position: relative;
    color: var(--ink-muted);
    font-size: 0.97rem;
  }
  .mgmt-points li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
  }

  #packages {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
  }
  .plan {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 26px;
    background: var(--paper);
    display: flex;
    flex-direction: column;
  }
  .plan.featured {
    border: 2px solid var(--accent);
    background: var(--surface);
    position: relative;
  }
  .plan.featured .flag {
    position: absolute;
    top: -13px;
    left: 24px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 4px;
  }
  .plan h3 {
    font-size: 1.3rem;
    margin-bottom: 4px;
  }
  .plan .tagline {
    color: var(--ink-muted);
    font-size: 0.92rem;
    margin-bottom: 18px;
    min-height: 44px;
  }
  .plan .price {
    font-family: Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2px;
  }
  .plan .price small {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--ink-muted);
  }
  .plan .price-note {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 18px;
  }
  .plan ul {
    list-style: none;
    margin-bottom: 24px;
    flex-grow: 1;
  }
  .plan li {
    padding: 7px 0 7px 24px;
    position: relative;
    font-size: 0.93rem;
    border-bottom: 1px solid var(--border);
  }
  .plan li:last-child { border-bottom: none; }
  .plan li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
  }
  .plan li.na { color: #a9aca6; }
  .plan li.na::before { content: "—"; color: #c9ccc6; }
  .plan .btn { text-align: center; }
  .plan .btn.secondary { margin-left: 0; }
  .packages-foot {
    margin-top: 28px;
    color: var(--ink-muted);
    font-size: 0.9rem;
    max-width: 70ch;
  }

  /* ---------- About ---------- */
  #about .wrap {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 56px;
    align-items: start;
  }
  .about-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 56px;
    align-items: start;
  }
  .eyebrow {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
  }
  .about-card,
  .about-aside {
    background: var(--accent-soft);
    border-radius: var(--radius);
    padding: 28px;
    font-size: 0.95rem;
  }
  .about-card h3,
  .about-aside h3 { font-size: 1rem; margin-bottom: 12px; }
  .about-card ul,
  .about-aside ul { list-style: none; }
  .about-card li,
  .about-aside li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(29,79,143,0.15);
  }
  .about-card li:last-child,
  .about-aside li:last-child { border-bottom: none; }
  #about p + p { margin-top: 16px; }

  /* ---------- Contact ---------- */
  #contact {
    background: var(--ink);
    color: var(--paper);
  }
  #contact h2 { color: var(--paper); }
  #contact .section-intro { color: #b9c2bd; }
  .contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 8px;
  }
  .contact-item {
    min-width: 200px;
  }
  .contact-item .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8fa39a;
    margin-bottom: 4px;
  }
  .contact-item a,
  .contact-item p:not(.label) {
    color: var(--paper);
    font-size: 1.1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
  }
  .contact-item p:not(.label) { border-bottom: none; margin: 0; }
  .contact-item a:hover { border-bottom-color: var(--paper); }

  .quote-form {
    margin-top: 40px;
    max-width: 560px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .quote-form .full { grid-column: 1 / -1; }
  .quote-form input,
  .quote-form textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.07);
    color: var(--paper);
    font: inherit;
    font-size: 0.95rem;
  }
  .quote-form input::placeholder,
  .quote-form textarea::placeholder { color: #8fa39a; }
  .quote-form input:focus,
  .quote-form textarea:focus {
    outline: 2px solid #2278c9;
    outline-offset: 1px;
    background: rgba(255,255,255,0.1);
  }
  .quote-form textarea { min-height: 110px; resize: vertical; }
  .quote-form button {
    grid-column: 1 / -1;
    justify-self: start;
    background: #2278c9;
    color: #fff;
    border: none;
    font: inherit;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius);
    cursor: pointer;
    min-height: 44px;
  }
  .quote-form button:hover { background: #1b62a5; }

  .contact-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: center;
  }
  .contact-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 280px;
    height: 280px;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow:
      0 0 0 8px rgba(34, 120, 201, 0.2),
      0 20px 50px rgba(0, 0, 0, 0.35);
  }
  .contact-logo img {
    width: 200px;
    max-width: 78%;
    height: auto;
    opacity: 0.9;
    filter: drop-shadow(0 6px 24px rgba(0,0,0,0.35));
  }

  footer {
    background: var(--ink);
    color: #8fa39a;
    font-size: 0.85rem;
    padding: 28px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  footer .wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px 32px;
  }
  footer .footer-meta p { margin: 0 0 4px; }
  footer .footer-meta strong { color: #d5ddd8; font-weight: 600; }
  footer .footer-meta a {
    color: #b9c2bd;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }
  footer .footer-meta a:hover { color: #fff; border-bottom-color: #fff; }
  .footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
  }
  .footer-nav a {
    color: #b9c2bd;
    text-decoration: none;
  }
  .footer-nav a:hover { color: #fff; }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* ---------- Responsive ---------- */
  @media (max-width: 760px) {
    nav ul { gap: 16px; }
    nav li.hide-mobile { display: none; }
    .services-list { grid-template-columns: 1fr; }
    .service-groups { grid-template-columns: 1fr; }
    .seo-grid { grid-template-columns: 1fr; }
    .mgmt-points { grid-template-columns: 1fr; }
    .before-after { grid-template-columns: 1fr; }
    .plans { grid-template-columns: 1fr; }
    .quote-form { grid-template-columns: 1fr; }
    #about .wrap { grid-template-columns: 1fr; }
    .about-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .contact-logo { display: none; }
    .btn.secondary { margin-left: 0; margin-top: 12px; }
    .hero { padding: 56px 0 48px; }
    section { padding: 56px 0; }
    footer .wrap { align-items: flex-start; }
  }

/* Accessibility: consistent visible keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
