/* The post blogs/corsica.html: its own parts (the panel, title and text come from post.css) */

/* the pixel font has no bold: a term is set off by colour */
.post_body b {
    font-weight: normal;
    color: var(--color-primary);
}

/* ---------- The route map (script/corsica-map.js) ---------- */
.post_body + .route_map {
    margin-top: 16px;
}

/* The map's own colours, light-dark(light, dark) like the site's; the eight days keep their colours */
.route_map {
    --map-bg: var(--color-card);
    --map-villa: var(--color-primary);
    --map-sea: light-dark(#DCE7EF, #16212C);
    --map-land: light-dark(#EEF0F3, #2B3038);
    --map-coast: light-dark(#9AA5B1, #4F5763);
    --map-road: light-dark(#BCC2CA, #414852);
    --map-trunk: light-dark(#7D8590, #8E949D);
    --map-border: light-dark(#9AA2AD, #5C636E);
    --d1: light-dark(#d1495b, #ff6b7d);
    --d2: light-dark(#e08e0b, #ffb23f);
    --d3: light-dark(#2f9e44, #5bd17a);
    --d4: light-dark(#1c7ed6, #5aa9ff);
    --d5: light-dark(#7048e8, #a58bff);
    --d6: light-dark(#c2255c, #f06595);
    --d7: light-dark(#0c8599, #3bc9db);
    --d8: light-dark(#495057, #ced4da);
}

/* The days as chips (a legend that selects): 32px tall like the category chip */
.day_chips {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
}

.day_chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;  /* the generated "build: snap" rules below widen it to a multiple of 16px */
    gap: 8px;
    padding: 2px 12px 2px 8px;
    border: 2px solid var(--color-line);
    border-radius: 6px;
    background-color: var(--color-card);
    color: var(--color-text-soft);
    font: var(--fs-chip) / var(--lh-chip) var(--font-primary);
    cursor: pointer;
}

.day_chip i {
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--c);
}

.day_chip.travel i {
    display: block;
    background: transparent;
    color: var(--c);
    line-height: 0;
}

.day_chip.travel i svg {
    display: block;
}

.day_chip[aria-pressed="true"] {
    border-color: var(--c);
    color: var(--color-primary);
}

.map_legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--color-secondary);
    font-size: var(--fs-small);
    line-height: var(--lh-small);
}

.legend_sw {
    flex: none;
    width: 32px;
    height: 6px;
    border-radius: 3px;
    background: var(--map-trunk);
}

/* The map itself: a screen frame like the pictures, 640px tall with its border (480px on phones) */
.map_box {
    position: relative;
    margin-top: 16px;
    overflow: hidden;
    border: 2px solid var(--color-line);
    border-radius: 8px;
    background-color: var(--map-sea);
    touch-action: none;
    font-size: var(--fs-small);
    line-height: var(--lh-small);
}

.map_box svg#map_svg {
    display: block;
    width: 100%;
    height: 636px;
    cursor: grab;
    user-select: none;
}

@media (max-width: 700px) {
    .map_box svg#map_svg {
        height: 476px;
    }
}

.map_box svg#map_svg.drag {
    cursor: grabbing;
}

.map_box .plabel {
    font-family: var(--font-primary);
    fill: var(--color-secondary);
}

.map_box .plabel[data-k="sea"],
.map_box .plabel[data-k="farsea"] {
    letter-spacing: .08em;
    fill: var(--map-coast);
}

.map_box .vlabel {
    font-family: var(--font-primary);
    fill: var(--color-primary);
    paint-order: stroke;
    stroke: var(--map-bg);
}

.map_box .dot {
    cursor: pointer;
}

.map_box .dot:focus-visible {
    outline: none;
    stroke: var(--color-primary);
}

/* Controls on the map: on the 16px grid, 16px from the frame's outer edge */
.map_scale {
    position: absolute;
    left: 14px;
    top: 14px;
    height: 32px;  /* 6px ruler + 24px text, padded to the grid */
    color: var(--color-secondary);
}

.map_zoom {
    position: absolute;
    right: 14px;
    top: 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.map_zoom button {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 24px;
}

.map_box button:focus-visible,
.day_chip:focus-visible,
.day:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.map_tip {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    box-sizing: border-box;
    max-width: 400px;     /* with the 16px inset: both edges on the grid */
    padding: 6px 14px;    /* the height is rounded up to 16px by corsica-map.js */
    border: 2px solid var(--color-line);
    border-radius: 8px;
    background-color: var(--color-card);
    color: var(--color-text-soft);
    box-shadow: var(--shadow-hard);
}

.map_tip b {
    font-weight: normal;
    color: var(--color-primary);
}

.map_tip .when {
    color: var(--color-secondary);
}

.route_map [hidden] {
    display: none !important;
}

/* The controls appear once the script has drawn the map */
.map_box:not(.ready) .map_zoom {
    visibility: hidden;
}

/* Day by day (hidden for now, like in the original: remove "hidden" from #map_log to show it) */
.map_log {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.day {
    min-width: 0;
    padding: 14px 16px 14px 14px;
    border: 2px solid var(--color-line);
    border-left: 4px solid var(--c);
    border-radius: 8px;
    background-color: var(--color-card);
    font-size: var(--fs-small);
    line-height: var(--lh-small);
    cursor: pointer;
}

.day.dim {
    opacity: .45;
}

.day h3 {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
}

.day h3 span,
.day .km,
.day .t {
    color: var(--color-secondary);
    font-size: var(--fs-chip);
}

.day h3 span {
    align-self: center;
}

.day .km {
    margin-bottom: 8px;
}

.day ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.day li {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 8px;
}

.day .gm {
    display: inline-block;
    margin-top: 16px;
    color: var(--c);
}

@media (prefers-reduced-motion: no-preference) {
    .route_map .route {
        transition: opacity .2s;
    }
}

/* build: snap - generated by build_snap.py from blogs/corsica.html: the sizes snapped to the 16px grid (see general.css, "Snapped to the grid"). Do not edit between these lines: run the script again after changing the page. */
@media screen {
    #map_chips > button:nth-child(1) { --snap-width: 160px; }
    #map_chips > button:nth-child(2) { --snap-width: 96px; }
    #map_chips > button:nth-child(3) { --snap-width: 96px; }
    #map_chips > button:nth-child(4) { --snap-width: 112px; }
    #map_chips > button:nth-child(5) { --snap-width: 128px; }
    #map_chips > button:nth-child(6) { --snap-width: 112px; }
    #map_chips > button:nth-child(7) { --snap-width: 96px; }
    #map_chips > button:nth-child(8) { --snap-width: 192px; }
    main > article:nth-child(2) > div:nth-child(1) > span:nth-child(1) { --snap-width: 96px; }
}
/* /build: snap */
