/* ========================================
   AREA GUIDES - Shared styles for neighborhood pages
   Used by: Upton, Great Boughton, Hoole, etc.
   ======================================== */

/* General Section Styling */
.section {
    padding: 3rem 2rem;
    border-bottom: 1px solid var(--border-gray, #E5E5E5);
}

.section:last-child {
    border-bottom: none;
}

.section-heading {
    text-align: center;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-heading .eyebrow {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-red, #FF4B6E);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    display: block;
}

.section-heading h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-black, #222);
    line-height: 1.2;
}

.section-heading p.subtitle {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

/* Cards Grid Layout */
.cards-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (min-width: 992px) {
    .cards-grid.three-up {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .cards-grid.two-up {
        grid-template-columns: 1fr 1fr;
    }
    .cards-grid.four-up {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
}

/* Four-up: 2x2 on tablet, single column on small mobile */
@media (min-width: 600px) and (max-width: 991px) {
    .cards-grid.four-up {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

@media (max-width: 599px) {
    .cards-grid.four-up {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }
}

/* ===== Professional styling for three-up content cards ===== */
.cards-grid.three-up .card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.5rem 1.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
}

.cards-grid.three-up .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-red, #FF4B6E) 0%, #FF6B88 100%);
    opacity: 0.9;
}

.cards-grid.three-up .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    border-color: #d1d5db;
}

.cards-grid.three-up .card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-black, #0f172a);
    line-height: 1.3;
    margin: 0.25rem 0 0.65rem 0;
    letter-spacing: -0.01em;
}

.cards-grid.three-up .card > p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
}

.cards-grid.three-up .card > p:last-child {
    margin-bottom: 0;
}

/* "Read Guide →" style anchors inside cards */
.cards-grid.three-up .card > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 0.5rem;
    color: var(--primary-red, #FF4B6E);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: gap 0.18s ease, color 0.18s ease;
}

.cards-grid.three-up .card > a:hover {
    color: #d63d5d;
    gap: 0.55rem;
}

/* Checklist lists inside cards */
.cards-grid.three-up .card .checklist {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.cards-grid.three-up .card .checklist li {
    position: relative;
    padding: 0.5rem 0 0.5rem 1.6rem;
    border-top: 1px solid #f1f3f5;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #475569;
}

.cards-grid.three-up .card .checklist li:first-child {
    border-top: none;
    padding-top: 0.25rem;
}

.cards-grid.three-up .card .checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 1.05rem;
    height: 1.05rem;
    background-color: #ecfdf5;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23047857' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.75rem 0.75rem;
}

.cards-grid.three-up .card .checklist li:first-child::before {
    top: 0.45rem;
}

.cards-grid.three-up .card .checklist li strong {
    display: block;
    color: var(--text-black, #0f172a);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

@media (max-width: 599px) {
    .cards-grid.three-up .card {
        padding: 1.25rem 1.25rem 1rem;
        border-radius: 10px;
    }
    .cards-grid.three-up .card h3 {
        font-size: 1.05rem;
    }
}

/* Polished card styling for four-up price cards (tablet/mobile primarily) */
.cards-grid.four-up .card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.cards-grid.four-up .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.cards-grid.four-up .card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f3f5;
}

.cards-grid.four-up .card p:nth-of-type(1) {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: var(--text-black, #1A1A1A);
    line-height: 1.2;
    margin: 0.25rem 0 0.5rem 0 !important;
}

.cards-grid.four-up .card p:nth-of-type(2) {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.8rem !important;
    font-weight: 700;
    color: #047857 !important;
    background: #ecfdf5;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    margin: 0 0 0.75rem 0 !important;
}

.cards-grid.four-up .card p:nth-of-type(3) {
    font-size: 0.85rem !important;
    color: #4b5563 !important;
    line-height: 1.5;
    margin: 0 !important;
}

@media (max-width: 599px) {
    .cards-grid.four-up .card {
        padding: 1rem 1.1rem;
        border-radius: 10px;
    }
    .cards-grid.four-up .card p:nth-of-type(1) {
        font-size: 1.35rem !important;
    }
}

/* Responsive table: convert to compact card list on mobile using data-label */
@media (max-width: 599px) {
    .table-container {
        border: none;
        border-radius: 0;
        overflow: visible;
        margin: 1rem 0;
    }

    .responsive-table {
        min-width: 0;
        width: 100%;
        font-size: 0.9rem;
        border-collapse: separate;
        border-spacing: 0;
    }

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

    .responsive-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        overflow: hidden;
    }

    .responsive-table tbody tr:hover {
        background: #fff;
    }

    .responsive-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .responsive-table tbody td {
        display: grid;
        grid-template-columns: 110px 1fr;
        column-gap: 0.5rem;
        align-items: baseline;
        padding: 0.4rem 0.75rem;
        border-bottom: 1px solid #f1f3f5;
        text-align: left;
        line-height: 1.35;
    }

    /* Cells whose data-label is longer (e.g. SDLT "First-time buyer") stack label above value */
    .sdlt-section .responsive-table tbody td {
        display: block;
        padding: 0.45rem 0.85rem;
    }

    .sdlt-section .responsive-table tbody td::before {
        display: block;
        margin-bottom: 0.15rem;
    }

    .responsive-table tbody tr td:last-child {
        border-bottom: none;
    }

    .responsive-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    /* First cell: primary identifier — slightly bolder, tinted background */
    .responsive-table tbody td:first-child {
        background: #f9fafb;
        font-weight: 700;
        font-size: 0.95rem;
        padding: 0.5rem 0.75rem;
    }

    .responsive-table tbody td:first-child::before {
        color: #9ca3af;
        font-size: 0.65rem;
    }

    /* Allow longer notes/descriptions to wrap nicely without forcing the label up */
    .responsive-table tbody td > * {
        min-width: 0;
    }
}

/* Card Styling */
.card {
    background: var(--neutral-white, #fff);
    border-radius: var(--border-radius-md, 12px);
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    border: 1px solid var(--border-gray, #eee);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-red, #FF4B6E);
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

.card ul {
    font-size: 0.95rem;
    padding-left: 1.2rem;
    margin-top: 1rem;
    color: #555;
}

.card li {
    margin-bottom: 0.5rem;
}

/* Icon inline styling for cards */
.icon-inline {
    flex-shrink: 0;
}

/* Responsive Table */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius-sm, 8px);
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 600px;
}

.responsive-table th,
.responsive-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.responsive-table thead th {
    background-color: var(--soft-gray, #f8f9fa);
    font-weight: 600;
    color: var(--text-black, #333);
}

.responsive-table tbody tr:last-child td {
    border-bottom: none;
}

.responsive-table tbody tr:hover {
    background-color: #f1f3f5;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 1rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: var(--primary-red, #FF4B6E);
}

.breadcrumbs span {
    color: #999;
    margin: 0 0.5rem;
}

.breadcrumbs .current {
    color: var(--text-black, #333);
    font-weight: 500;
}

/* Mobile Swipe Indicator */
.mobile-swipe-indicator {
    display: none;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
    color: #856404;
}

/* Hero Layout for Area Pages */
.hero-layout {
    margin-top: 50px;
    padding: 0 2rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 3rem;
    align-items: center;
}

.hero-layout .section-massive-heading {
    text-align: left;
}

.hero-layout .section-main-smaller {
    font-size: 3.5rem;
    text-align: left;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-black, #1A1A1A);
}

/* Author Cards */
.author-cards {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* CTA Banner */
.viewing-cta-hero {
    background: linear-gradient(135deg, var(--primary-red, #FF4B6E) 0%, #FF6B88 100%);
    border-radius: var(--border-radius-lg, 16px);
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
    box-shadow: 0 8px 24px rgba(255, 75, 110, 0.2);
}

.btn-tertiary {
    display: inline-block;
    background: var(--neutral-white, white);
    color: var(--primary-red, #FF4B6E);
    padding: 1rem 2rem;
    border-radius: var(--border-radius-sm, 8px);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-tertiary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Pill Badges */
.pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    background: rgba(255, 75, 110, 0.1);
    color: var(--primary-red, #FF4B6E);
    border-radius: 4px;
    margin-left: 0.3rem;
    font-weight: 600;
}

/* Mobile Specific */
@media (max-width: 768px) {
    .section-heading h2 {
        font-size: 2rem;
    }

    .section-main-smaller {
        font-size: 2rem;
    }

    .author-cards {
        grid-template-columns: 1fr !important;
    }

    .price-comparison-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

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

    .hero-layout {
        grid-template-columns: 1fr !important;
        padding: 0 1rem !important;
        gap: 1.5rem !important;
    }

    .breadcrumbs {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .mobile-swipe-indicator {
        display: block;
    }
}

/* Utility: Header Spacing */
.header-spacing {
    height: 80px;
}

/* Content Section */
.content-section {
    padding: 0 2rem;
}

/* Main Content */
.main-content {
    background: var(--neutral-white, #fff);
}
