/* ============================================================
   Advantec Computing — Extra styles for SEO/content pages.
   Loaded after style.css and animations.css.
   Adds styles for: areas-served grid, article system, breadcrumbs,
   related-links blocks, town/service page extras.
   ============================================================ */

/* --- Container variants --- */
.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Breadcrumbs --- */
.breadcrumb {
    font-size: 14px;
    color: var(--gray-500, #6b7280);
    margin-bottom: 24px;
    line-height: 1.6;
}
.breadcrumb a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.breadcrumb [aria-current="page"] {
    color: var(--gray-700, #374151);
}

/* --- Hero variants for town/service pages --- */
.town-hero .hero-description,
.service-hero .hero-description {
    max-width: 760px;
}
.town-hero .page-title,
.service-hero .page-title {
    font-family: var(--font-space, 'Space Grotesk', sans-serif);
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
    font-weight: 700;
    color: var(--white, #fff);
    margin-bottom: 20px;
}
.town-hero .text-gradient,
.service-hero .text-gradient {
    display: block;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Areas served grid (homepage) --- */
.areas-served {
    padding: 80px 0;
    background: var(--gray-50, #f9fafb);
}
.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 48px;
}
.area-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 24px;
    border: 1px solid var(--gray-200, #e5e7eb);
    background: #fff;
    border-radius: var(--border-radius, 12px);
    text-decoration: none;
    color: var(--gray-900, #111827);
    transition: all 200ms ease;
}
.area-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color, #2563eb);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.08));
}
.area-card .area-name {
    font-weight: 600;
    font-size: 16px;
}
.area-card .area-meta {
    font-size: 13px;
    color: var(--gray-500, #6b7280);
}

/* --- Latest articles strip (homepage) --- */
.latest-articles {
    padding: 80px 0;
}
.articles-grid-home {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    margin-top: 48px;
}
@media (max-width: 768px) {
    .articles-grid-home {
        grid-template-columns: 1fr;
    }
}
.articles-secondary {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.articles-cta {
    text-align: center;
    margin-top: 32px;
}

/* --- Article cards (grid + featured) --- */
.article-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--border-radius, 12px);
    overflow: hidden;
    text-decoration: none;
    color: var(--gray-900, #111827);
    transition: all 250ms ease;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(0,0,0,.10));
    border-color: var(--primary-color, #2563eb);
}
.article-card .article-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--gray-100, #f3f4f6);
}
.article-card .article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.article-card .article-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.article-card .article-category {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: var(--primary-color, #2563eb);
}
.article-card h3 {
    font-family: var(--font-space, 'Space Grotesk', sans-serif);
    font-size: 20px;
    line-height: 1.3;
    margin: 0;
}
.article-card p {
    color: var(--gray-600, #4b5563);
    line-height: 1.5;
    margin: 0;
}
.article-card .article-meta-line {
    font-size: 13px;
    color: var(--gray-500, #6b7280);
    margin-top: auto;
}
.article-card .article-readmore {
    font-weight: 600;
    color: var(--primary-color, #2563eb);
    margin-top: 8px;
}
.article-card-featured {
    grid-row: span 2;
}
.article-card-featured h3 {
    font-size: 26px;
}
.article-card-featured .article-image {
    aspect-ratio: 16 / 10;
}

/* --- Articles archive listing --- */
.articles-listing {
    padding: 60px 0 100px;
}
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* --- Article detail page --- */
.article-detail {
    padding: 60px 0 80px;
}
.article-header {
    margin-bottom: 32px;
}
.article-title {
    font-family: var(--font-space, 'Space Grotesk', sans-serif);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.2;
    margin: 12px 0 16px;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--gray-500, #6b7280);
    margin-bottom: 24px;
}
.article-featured-image img {
    width: 100%;
    border-radius: var(--border-radius, 12px);
    margin-bottom: 32px;
}
.article-body {
    font-size: 18px;
    line-height: 1.7;
    color: var(--gray-800, #1f2937);
}
.article-body h2 {
    font-family: var(--font-space, 'Space Grotesk', sans-serif);
    font-size: 28px;
    margin: 40px 0 16px;
    line-height: 1.3;
}
.article-body h3 {
    font-family: var(--font-space, 'Space Grotesk', sans-serif);
    font-size: 22px;
    margin: 32px 0 12px;
}
.article-body p,
.article-body ul,
.article-body ol {
    margin-bottom: 18px;
}
.article-body ul,
.article-body ol {
    padding-left: 28px;
}
.article-body li {
    margin-bottom: 8px;
}
.article-body a {
    color: var(--primary-color, #2563eb);
    text-decoration: underline;
}
.article-body strong {
    color: var(--gray-900, #111827);
}
.article-body blockquote {
    border-left: 4px solid var(--primary-color, #2563eb);
    padding: 8px 24px;
    margin: 24px 0;
    color: var(--gray-700, #374151);
    font-style: italic;
    background: var(--gray-50, #f9fafb);
}
.article-body code {
    background: var(--gray-100, #f3f4f6);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0 16px;
}
.article-tag {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-700, #374151);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
}

/* --- Related links blocks (town/service/article pages) --- */
.related-links {
    padding: 60px 0;
    background: var(--gray-50, #f9fafb);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}
.related-grid h3 {
    font-family: var(--font-space, 'Space Grotesk', sans-serif);
    font-size: 22px;
    margin-bottom: 16px;
}
.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.link-list li {
    margin-bottom: 10px;
}
.link-list a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    font-size: 16px;
    line-height: 1.4;
}
.link-list a:hover {
    text-decoration: underline;
}

/* ============================================================
   Homepage hero — atmospheric photo background, centered text.
   Photo dimmed to 50%, dark scrim over it, content centred over.
   ============================================================ */
.hero {
    position: relative;
    min-height: 640px;
    background-color: #0a0f1e;
    overflow: hidden;
}

.hero .hero-bg {
    position: absolute !important;
    inset: 0 !important;
    background-image: url('/img/hero.jpg');
    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;
    opacity: 0.55;
    z-index: 1;
}

.hero .hero-gradient {
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(
        180deg,
        rgba(10, 15, 30, 0.45) 0%,
        rgba(10, 15, 30, 0.30) 35%,
        rgba(10, 15, 30, 0.55) 75%,
        rgba(10, 15, 30, 0.85) 100%
    ) !important;
    z-index: 2;
}

.hero .floating-shapes {
    display: none !important;
}

.hero .hero-image {
    display: none !important;
}

.hero .hero-content {
    position: relative !important;
    z-index: 5 !important;
    grid-template-columns: 1fr !important;
    max-width: 920px !important;
    margin: 0 auto !important;
    padding: 80px 24px !important;
    text-align: center !important;
    display: block !important;
}

.hero .hero-text {
    text-align: center !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

.hero .hero-title {
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.65) !important;
}

.hero .hero-description {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55) !important;
    max-width: 680px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.hero .badge.animate-fade-in {
    display: inline-flex !important;
}

.hero .hero-buttons {
    justify-content: center !important;
}

.hero .hero-stats {
    justify-content: center !important;
}

.hero .scroll-indicator {
    z-index: 5;
}

/* Force fade/slide-in animation elements to their final state — defensive
   against headless rendering and JS-disabled browsers. */
.hero .animate-fade-in,
.hero .animate-fade-in-delay,
.hero .animate-fade-in-delay-2,
.hero .animate-slide-up {
    opacity: 1 !important;
    animation-fill-mode: both !important;
}

/* Strengthen text scrim for headline area specifically */
.hero .hero-title {
    color: #ffffff !important;
}

@media (max-width: 768px) {
    .hero {
        min-height: 600px;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow: hidden !important;
        box-sizing: border-box;
    }
    .hero .hero-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 80px 16px 60px !important;
        box-sizing: border-box !important;
    }
    .hero .hero-text {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
    }
    .hero .hero-title {
        font-size: clamp(22px, 6.5vw, 34px) !important;
        line-height: 1.15 !important;
        margin-bottom: 12px !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
        max-width: calc(100vw - 32px) !important;
    }
    .hero .hero-description {
        font-size: 15px !important;
        line-height: 1.5 !important;
        max-width: calc(100vw - 32px) !important;
        padding: 0 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }
    .hero .hero-buttons {
        flex-wrap: wrap !important;
        gap: 10px !important;
        margin-top: 22px !important;
        justify-content: center !important;
    }
    .hero .hero-buttons .btn {
        min-width: 0 !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
    .hero .hero-stats {
        gap: 12px !important;
        margin-top: 28px !important;
    }
    .hero .stat {
        flex: 1 1 30%;
        min-width: 0;
    }
    .hero .stat-number {
        font-size: 26px !important;
    }
    .hero .stat-label {
        font-size: 12px !important;
        line-height: 1.3;
    }
}

/* Stop body horizontal scroll on small viewports just in case */
@media (max-width: 768px) {
    html, body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .hero,
    .hero .hero-bg,
    .hero .hero-gradient,
    .hero .hero-content,
    .hero .hero-text,
    .hero .hero-title,
    .hero .hero-description,
    .hero .hero-buttons,
    .hero .hero-stats {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    .hero .hero-buttons .btn {
        flex: 1 1 calc(50% - 6px) !important;
        max-width: calc(50% - 6px) !important;
        text-align: center;
        padding: 12px 8px !important;
        font-size: 14px !important;
    }
    .hero .hero-buttons .btn span {
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

/* --- Town hero route note --- */
.route-note {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    margin-top: 16px;
    max-width: 720px;
    line-height: 1.5;
}

/* --- Town page extras --- */
.problem-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}
.problem-list li {
    padding: 10px 0 10px 28px;
    position: relative;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    color: var(--gray-700, #374151);
}
.problem-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 12px;
    color: var(--secondary-color, #10b981);
    font-weight: 700;
}

/* --- Footer extras (address line, areas line) --- */
.footer-address {
    font-size: 14px;
    line-height: 1.5;
    margin: 12px 0 4px;
}
.footer-phone a {
    color: var(--white, #fff);
    font-weight: 600;
    text-decoration: none;
}
.footer-phone a:hover {
    text-decoration: underline;
}
.footer-areas-line {
    border-top: 1px solid rgba(255,255,255,.10);
    padding-top: 24px;
    margin-top: 24px;
    font-size: 14px;
    color: var(--gray-400, #9ca3af);
    line-height: 1.6;
}

/* --- Error page --- */
.error-page .hero-content {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}
.error-page .hero-buttons {
    justify-content: center;
}

/* --- Visible breadcrumb on dark hero backgrounds --- */
.service-hero .breadcrumb,
.town-hero .breadcrumb {
    color: rgba(255,255,255,.85);
}
.service-hero .breadcrumb a,
.town-hero .breadcrumb a {
    color: rgba(255,255,255,.95);
}
.service-hero .breadcrumb [aria-current="page"],
.town-hero .breadcrumb [aria-current="page"] {
    color: rgba(255,255,255,.7);
}

/* --- Generic service-detail-card consistency on new pages --- */
.service-detail-card .service-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 18px;
    background: var(--primary-color, #2563eb);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 200ms ease;
}
.service-detail-card .service-btn:hover {
    background: var(--primary-dark, #1e40af);
}
