/* ==========================================================================
   City and country page templates
   Loaded only on those two templates, via $PAGE_CSS.

   Design intent: these pages must not read as a generic CMS template.
   The devices doing that work are a dark branded hero with a data strip,
   a sticky in-page nav, eyebrow labels, and cards that show the
   constraint -> response pairing rather than listing flat bullet points.
   ========================================================================== */

:root {
    --tpl-line: rgba(0, 48, 73, .09);
    --tpl-line-soft: rgba(0, 48, 73, .06);
}

/* ==========================================================================
   1. Hero
   ========================================================================== */

.tpl-hero {
    position: relative;
    overflow: hidden;
    padding: 54px 0 0;
    background:
        radial-gradient(1100px 420px at 82% -10%, rgba(211, 47, 47, .28), transparent 60%),
        radial-gradient(700px 380px at 8% 110%, rgba(240, 173, 78, .14), transparent 62%),
        linear-gradient(160deg, #00263a 0%, #003049 55%, #00253a 100%);
    color: #fff;
}

/* faint grid, keeps the flat colour from looking empty */
.tpl-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(900px 380px at 20% 0%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(900px 380px at 20% 0%, #000 20%, transparent 78%);
    pointer-events: none;
}

.tpl-hero > .container {
    position: relative;
    z-index: 1;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: rgba(255, 255, 255, .55);
    margin-bottom: 22px;
}

.breadcrumb a {
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: #fff;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: #ff8a80;
    margin-bottom: 16px;
}

.eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.tpl-hero h1 {
    font-size: clamp(2rem, 4.4vw, 3.15rem);
    line-height: 1.08;
    letter-spacing: -.02em;
    font-weight: 800;
    color: #fff;
    margin-bottom: 18px;
    max-width: 20ch;
}

.tpl-intro {
    font-size: 1.08rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, .78);
    max-width: 66ch;
    margin: 0;
}

.tpl-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.tpl-hero-actions .btn-primary {
    box-shadow: 0 10px 26px rgba(211, 47, 47, .34);
}

.btn-ghost {
    display: inline-block;
    padding: 14px 26px;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .5);
    color: #fff;
}

/* --- hero data strip --------------------------------------------------- */

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1px;
    margin-top: 44px;
    background: rgba(255, 255, 255, .1);
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    border-bottom: 0;
}

.hero-stat {
    background: rgba(0, 32, 50, .55);
    backdrop-filter: blur(6px);
    padding: 20px 22px;
    display: flex;
    gap: 13px;
    align-items: flex-start;
}

.hero-stat i {
    color: #ff8a80;
    font-size: 1.3rem;
    line-height: 1.25;
    flex-shrink: 0;
}

.hero-stat strong {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 2px;
}

.hero-stat span {
    font-size: .82rem;
    color: rgba(255, 255, 255, .58);
    line-height: 1.4;
}

/* ==========================================================================
   2. Sticky in-page nav
   ========================================================================== */

.tpl-subnav {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--tpl-line);
}

.tpl-subnav ul {
    display: flex;
    gap: 4px;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}

.tpl-subnav ul::-webkit-scrollbar {
    display: none;
}

.tpl-subnav a {
    display: block;
    white-space: nowrap;
    padding: 16px 14px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tpl-subnav a:hover {
    color: var(--primary);
    border-bottom-color: rgba(211, 47, 47, .35);
}

/* ==========================================================================
   3. Section shell
   ========================================================================== */

.city-block {
    padding: 72px 0;
    scroll-margin-top: 70px;
}

.city-block.alt {
    background: var(--bg-light);
    border-block: 1px solid var(--tpl-line-soft);
}

.city-block .container.narrow > * {
    max-width: 860px;
}

.blk-head {
    max-width: 780px;
    margin-bottom: 8px;
}

.blk-head .eyebrow {
    color: var(--primary);
}

.blk-head h2 {
    font-size: clamp(1.55rem, 2.5vw, 2.1rem);
    line-height: 1.2;
    letter-spacing: -.015em;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.blk-head p {
    font-size: 1.02rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
}

.city-block .container.narrow > p {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.03rem;
    margin-bottom: 18px;
}

/* ==========================================================================
   4. Neighbourhood / destination cards
   ========================================================================== */

.hood-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 18px;
    margin-top: 38px;
}

.hood-card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--tpl-line);
    border-radius: 18px;
    padding: 26px 26px 24px;
    transition: var(--transition);
    overflow: hidden;
}

/* accent rule that fills in on hover */
.hood-card::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .25s ease;
}

.hood-card:hover {
    border-color: rgba(211, 47, 47, .28);
    box-shadow: 0 16px 40px rgba(0, 48, 73, .09);
    transform: translateY(-3px);
}

.hood-card:hover::after {
    transform: scaleY(1);
}

.hood-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .82rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.hood-card h3 {
    font-size: 1.13rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -.01em;
    margin-bottom: 10px;
}

.hood-constraint {
    color: var(--text-muted);
    font-size: .94rem;
    line-height: 1.62;
    margin-bottom: 16px;
}

.hood-response {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .92rem;
    line-height: 1.55;
    color: var(--text-dark);
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid var(--tpl-line-soft);
}

.hood-response i {
    color: #0f9d58;
    font-size: 1.05rem;
    flex-shrink: 0;
    line-height: 1.35;
}

/* ==========================================================================
   5. Challenges / customs — numbered cards
   ========================================================================== */

.challenge-list {
    list-style: none;
    counter-reset: ch;
    margin-top: 38px;
    display: grid;
    gap: 14px;
}

.challenge-list li {
    counter-increment: ch;
    position: relative;
    background: var(--white);
    border: 1px solid var(--tpl-line);
    border-radius: 16px;
    padding: 26px 28px 26px 88px;
    overflow: hidden;
    transition: var(--transition);
}

.challenge-list li:hover {
    border-color: rgba(211, 47, 47, .22);
    box-shadow: 0 12px 30px rgba(0, 48, 73, .07);
}

/* oversized ghost numeral */
.challenge-list li::before {
    content: "0" counter(ch);
    position: absolute;
    left: 22px;
    top: 20px;
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.04em;
    color: rgba(211, 47, 47, .16);
}

.challenge-list h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 9px;
}

.challenge-list p {
    margin-bottom: 0;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: .97rem;
}

/* ==========================================================================
   6. Checklists (quote factors, documents)
   ========================================================================== */

.factor-list {
    list-style: none;
    margin: 34px 0 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 10px;
}

.factor-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--white);
    border: 1px solid var(--tpl-line);
    border-radius: 12px;
    padding: 15px 18px;
    color: var(--text-dark);
    line-height: 1.55;
    font-size: .96rem;
    transition: var(--transition);
}

.factor-list li:hover {
    border-color: rgba(211, 47, 47, .25);
    background: #fff;
}

.factor-list i {
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1.45;
}

/* ==========================================================================
   7. Route strip — country pages
   ========================================================================== */

.route-strip {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 38px;
    background: var(--white);
    border: 1px solid var(--tpl-line);
    border-radius: 18px;
    overflow: hidden;
}

.route-node {
    flex: 1;
    padding: 24px 22px;
    text-align: center;
}

.route-node .route-label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 7px;
}

.route-node strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.route-node.is-origin,
.route-node.is-dest {
    background: var(--bg-light);
}

.route-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: var(--primary);
    font-size: 1.3rem;
    background: var(--white);
}

.transit-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(211, 47, 47, .07), rgba(240, 173, 78, .07));
    border: 1px solid rgba(211, 47, 47, .14);
    border-radius: 14px;
    padding: 18px 20px;
    margin-top: 24px;
    color: var(--text-dark) !important;
    line-height: 1.65;
    font-size: .97rem;
}

.transit-note i {
    color: var(--primary);
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1.35;
}

/* ==========================================================================
   8. CTA band
   ========================================================================== */

.tpl-cta {
    padding: 0 0 72px;
}

.tpl-cta-inner {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 46px 48px;
    background:
        radial-gradient(600px 260px at 88% 0%, rgba(211, 47, 47, .34), transparent 62%),
        linear-gradient(150deg, #00263a, #003049);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
}

.tpl-cta-inner h2 {
    font-size: clamp(1.4rem, 2.2vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -.015em;
    color: #fff;
    margin-bottom: 8px;
    max-width: 22ch;
}

.tpl-cta-inner p {
    color: rgba(255, 255, 255, .72);
    margin: 0;
    max-width: 52ch;
    line-height: 1.6;
}

.tpl-cta-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ==========================================================================
   9. Related links
   ========================================================================== */

.city-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin-top: 34px;
}

.city-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 22px;
    border-radius: 14px;
    border: 1px solid var(--tpl-line);
    background: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.city-link:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 28px rgba(0, 48, 73, .08);
    transform: translateY(-2px);
}

.city-link strong {
    display: block;
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 3px;
}

.city-link span {
    font-size: .84rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.city-link i {
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.city-link:hover i {
    transform: translateX(3px);
}

/* ==========================================================================
   10. Responsive
   ========================================================================== */

@media (max-width: 991px) {
    .tpl-subnav {
        top: 64px;
    }
}

@media (max-width: 768px) {
    .tpl-hero {
        padding: 30px 0 0;
    }

    .tpl-hero h1 {
        max-width: none;
    }

    .tpl-intro {
        font-size: 1rem;
    }

    .tpl-hero-actions .btn,
    .tpl-hero-actions .btn-ghost {
        width: 100%;
        text-align: center;
    }

    .hero-stats {
        margin-top: 32px;
        grid-template-columns: 1fr;
    }

    .city-block {
        padding: 48px 0;
    }

    .hood-grid,
    .factor-list {
        grid-template-columns: 1fr;
    }

    .challenge-list li {
        padding: 22px 22px 22px 22px;
    }

    .challenge-list li::before {
        position: static;
        display: block;
        font-size: 1.9rem;
        margin-bottom: 4px;
    }

    /* The strip stacks vertically. Rotate the ICON only - rotating the whole
       arrow cell turns its white background into a vertical band that lies
       across the node labels. */
    .route-strip {
        flex-direction: column;
    }

    .route-node {
        width: 100%;
        padding: 18px 20px;
    }

    .route-arrow {
        padding: 8px 0;
        background: var(--white);
        border-block: 1px solid var(--tpl-line-soft);
    }

    .route-arrow i {
        display: block;
        transform: rotate(90deg);
    }

    .tpl-cta-inner {
        padding: 32px 26px;
    }

    .tpl-cta-actions .btn,
    .tpl-cta-actions .btn-ghost {
        width: 100%;
        text-align: center;
    }
}

/* --- blog ---------------------------------------------------------------- */

.post-meta {
    margin-top: 22px;
    font-size: .88rem;
    color: rgba(255, 255, 255, .6);
}

.post-card { padding: 0; }

.post-card-link {
    display: block;
    padding: 26px;
    text-decoration: none;
    color: inherit;
}

.post-card h3 {
    font-size: 1.16rem;
    line-height: 1.32;
    margin-bottom: 12px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 16px 0 0;
    padding-top: 15px;
    border-top: 1px solid var(--tpl-line-soft);
    font-size: .84rem;
    color: var(--text-muted);
}

.post-card-meta i {
    margin-left: auto;
    color: var(--primary);
    font-size: 1.1rem;
    transition: var(--transition);
}

.post-card:hover .post-card-meta i { transform: translateX(3px); }

/* article body rhythm */
#article h2 { margin-top: 40px; }
#article h2:first-child { margin-top: 0; }
#article .factor-list { margin: 22px 0 8px; }

/* --- article layout with sidebar ---------------------------------------- */

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 56px;
    padding: 64px 20px;
    align-items: start;
}

.post-main { min-width: 0; }

.post-main h2 {
    font-size: clamp(1.4rem, 2.2vw, 1.85rem);
    line-height: 1.25;
    letter-spacing: -.015em;
    font-weight: 800;
    color: var(--text-dark);
    margin: 44px 0 16px;
    scroll-margin-top: 90px;
}

.post-main h2:first-child { margin-top: 0; }

.post-main p {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.04rem;
    margin-bottom: 18px;
    max-width: 68ch;
}

.post-main .factor-list {
    grid-template-columns: 1fr;
    margin: 24px 0 10px;
    max-width: 68ch;
}

/* --- sidebar ------------------------------------------------------------- */

.post-aside {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 14px;
}

.aside-card {
    background: var(--white);
    border: 1px solid var(--tpl-line);
    border-radius: 16px;
    padding: 20px 22px;
}

.aside-title {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.aside-toc {
    list-style: none;
    counter-reset: toc;
    display: grid;
    gap: 2px;
}

.aside-toc li { counter-increment: toc; }

.aside-toc a {
    display: flex;
    gap: 10px;
    padding: 7px 0;
    font-size: .9rem;
    line-height: 1.45;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

.aside-toc a::before {
    content: counter(toc);
    flex-shrink: 0;
    width: 20px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--primary);
    opacity: .55;
}

.aside-toc a:hover { color: var(--primary); }

.aside-links { list-style: none; display: grid; gap: 4px; }

.aside-links a {
    display: block;
    padding: 10px 12px;
    margin: 0 -12px;
    border-radius: 10px;
    text-decoration: none;
    transition: var(--transition);
}

.aside-links a:hover { background: var(--bg-light); }

.aside-links strong {
    display: block;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-dark);
    margin-bottom: 3px;
}

.aside-links span { font-size: .78rem; color: var(--text-muted); }

.aside-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: .86rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.aside-all i { transition: var(--transition); }
.aside-all:hover i { transform: translateX(3px); }

.aside-cta {
    background: linear-gradient(155deg, #00263a, #003049);
    border-color: transparent;
    color: #fff;
}

.aside-cta .aside-title { color: rgba(255, 255, 255, .55); }

.aside-cta p {
    font-size: .92rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .78);
    margin-bottom: 16px;
}

.aside-cta .btn-primary { width: 100%; text-align: center; }
.aside-cta .aside-all { color: #ff8a80; }

@media (max-width: 1000px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 44px 20px;
    }

    .post-aside { position: static; }

    /* the table of contents is a desktop affordance; on mobile it just
       pushes the related guides and the CTA below the fold for no gain */
    .post-aside > nav[aria-label="In this article"] { display: none; }
}

/* ==========================================================================
   Media layout — hero, side images, two-column FAQ
   Shared by the city, country and article templates, so any page created
   later inherits it without touching CSS.
   ========================================================================== */

.tpl-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}

.tpl-hero.has-media .tpl-hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}

.tpl-hero-text { min-width: 0; }

.tpl-hero-media {
    align-self: center;
    padding-bottom: 34px;
}

.tpl-hero-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 16, 26, .45);
}

/* the hero stats strip spans the text column only */
.tpl-hero-grid { padding-bottom: 8px; }

/* --- side image next to a text block ------------------------------------ */

.media-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    gap: 46px;
    align-items: start;
}

.media-text { min-width: 0; }
.media-text > * { max-width: 100%; }

.media-side {
    position: sticky;
    top: 90px;
    margin: 0;
}

.media-side img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    border: 1px solid var(--tpl-line);
    box-shadow: 0 14px 36px rgba(0, 48, 73, .10);
}

/* --- FAQ in two columns -------------------------------------------------- */

.faq-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.faq-cols .faq-list { display: grid; gap: 12px; align-content: start; }

@media (max-width: 991px) {
    .tpl-hero.has-media .tpl-hero-grid,
    .media-grid,
    .faq-cols {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    /* on mobile the picture goes under the text, and stops being sticky */
    .tpl-hero-media { padding-bottom: 0; order: 2; }
    .media-side { position: static; max-width: 520px; }
}
