/* ============================================================
   ORANGEWORKER — Mid-Century Modern Design System
   ============================================================ */

@font-face {
    font-family: 'Clarendon';
    src: url('/Clarendon.woff') format('woff');
}

:root {
    --orange:      #ff5f00;
    --orange-dk:   #cc4c00;
    --cream:       #f4edd8;
    --cream-dk:    #e8dfc4;
    --charcoal:    #1c1812;
    --mustard:     #d4961a;
    --mustard-dk:  #a17113;
    --teal:        #2d7873;
    --teal-dk:     #1b4b48;
    --white:       #ffffff;
    --slate:       #45413d;
    --brown:       #6b4423;
    --sage:        #8a9060;
    --concrete:    #dacebd;


    /* Defaults: sans-serif for body; heading font set separately */
    --ff-body:   Arial, Helvetica, sans-serif;
    --ff-heading: 'Clarendon', Georgia, 'Times New Roman', serif;

    --sp-xs: 0.5rem;
    --sp-sm: 1rem;
    --sp-md: 2rem;
    --sp-lg: 3rem;
    --sp-xl: 5rem;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ----- Base ----- */
body {
    background-color: var(--cream);
    color: var(--charcoal);
    font-family: var(--ff-body);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* headings use Clarendon */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--ff-heading);
}

a { color: inherit; }

/* ============================================================
   SHARED: Multi-color stripe band (MCM, SVG only)
   3 colors: sage #8a9060 · orange #d4631a · brown #6b4423
   Shape: flat → step → flat (elbow)

   links  → angular step UP   (sharp diagonal, right side higher)
   work   → angular step DOWN (sharp diagonal, right side lower)
   photes → smooth step DOWN  (cubic bezier, right side lower)
   haiku  → smooth step UP    (cubic bezier, right side higher)

   ViewBox: 0 0 1200 94
   3 stripes × 16px, 4px gaps, 4px top/bottom margin at nearest stripe
   Step amplitude 30px — nearest stripe top is always y=4 (4px from header edge)
   Transition: x 240→480 (1/5 width), flat sections 1/5 and 3/5
   ============================================================ */

.stripe-band {
    display: block;
    width: 100%;
    line-height: 0;
    overflow: hidden;
    background-color: var(--orange);
}

.stripe-band svg {
    display: block;
    width: 100%;
    height: 120px;
}

/* ============================================================
   HOMEPAGE  (index.html)
   ============================================================ */

.home-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100dvh;
}

/* ---- Brand panel (left / top-on-mobile) ---- */
.brand-panel {
    background-color: var(--orange);
    padding: var(--sp-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Large ghost ring — bottom-right corner */
.brand-panel::before {
    content: '';
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    border: 56px solid rgba(255,255,255,.09);
    bottom: -190px;
    right: -190px;
    pointer-events: none;
}

/* Smaller ghost ring — upper area */
.brand-panel::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 28px solid rgba(255,255,255,.10);
    top: var(--sp-lg);
    right: var(--sp-lg);
    pointer-events: none;
}

.brand-label {
    font-family: var(--ff-heading);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
    position: relative;
    z-index: 1;
}

/* Two concentric ring "stripes" (::before = outer, ::after = inner), each
   an 8px stroke on its own circle with a transparent fill, gapped 4px
   (half the stroke width) apart. Being genuinely transparent rather than
   a hardcoded spacer color, this drops onto any background color and
   still reads correctly — recolor both rings at once via
   --brand-mark-color. */
.brand-logo {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    --brand-mark-color: var(--white);
    opacity: 0.5;
    margin: auto 0;
}

.brand-logo::before,
.brand-logo::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 8px solid var(--brand-mark-color);
}

.brand-logo::before {
    inset: 0;
}

.brand-logo::after {
    inset: 12px;
}

.brand-wordmark {
    font-family: var(--ff-heading);
    font-size: clamp(3rem, 6.5vw, 7rem);
    line-height: 0.85;
    letter-spacing: -0.02em;
    color: var(--white);
    position: relative;
    z-index: 1;
}

/* ---- Content panel (right / bottom-on-mobile) ---- */
.content-panel {
    background-color: var(--cream);
    padding: var(--sp-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--sp-md);
}


/* ============================================================
   Navigation
   ============================================================ */

.header {
    overflow-x: clip;
}
#nav-wrapper {
    position: relative;
    top: 10px;
    /* rotate() is purely visual and doesn't grow the flow box, so make
       room by hand for the diagonal items' footprint below the baseline */
    padding-bottom: 90px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 10px;
    display: flex;
    flex-direction: row;
}

.nav-list li {
    position: relative;
    margin-left: -1.5em;
}

/* Overlap each item's diagonal edge into the next one's, like a fan of cards */
.nav-list li + li {
    margin-left: -5.25em;
}

.nav-list li:nth-child(2)::before {
    background-color: var(--teal);
}

.nav-list li:nth-child(3)::before {
    background-color: var(--orange-dk);
}

.nav-list li:nth-child(4)::before {
    background-color: var(--sage);
}

.nav-item {
    display: block;
    position: relative;
    z-index: 1;
    width: 8em;
    padding: 0.1em .5em 0.1em 1em;
    transform: rotate(-45deg);
    transform-origin: 100% 0%;
    margin-top: -1.75rem;
    text-align: right;
}

/* Skewed parallelogram background — text stays upright */
.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--mustard);
    transform: skewX(45deg);
    z-index: -1;
}

.nav-link {
    font-family: var(--ff-body);
    font-size: 1rem;
    color: var(--white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--charcoal);
}

/* Hero */
.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-md);
}

.tagline {
    font-family: var(--ff-body);
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    line-height: 1.05;
    color: var(--charcoal);
    max-width: 16ch;
}

.accent-row {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

.accent-line {
    height: 4px;
    width: 64px;
    background-color: var(--teal);
    flex-shrink: 0;
}

.accent-label {
    font-family: var(--ff-body);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--teal);
}

/* Footer */
.site-footer {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--charcoal);
    opacity: 0.4;
}

/* ============================================================
   SHARED: PAGE HEADER  (links, work, photes, haiku)
   ============================================================ */

/* helper class to allow themes to float/nav to one side of content
   use `.header.left` or `.header.right` in a stylesheet and
   the layout will adjust accordingly. themes can also overwrite this
   entirely if they want different positioning logic. */
.header.left { order: -1; }
.header.right { order: 1; }

/* subtitle under the brand name */
.page-subhead {
    display: block;
    font-size: 1.75rem;
    color: var(--charcoal);
    opacity: 0.6;
    line-height: 1;
    margin: 0;
    text-transform:uppercase;
}

.branding-header {
    background-color: var(--concrete);
    padding: var(--sp-sm) var(--sp-sm);
    display: flex;
    gap: var(--sp-sm);
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.heading-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.page-wordmark {
    font-family: var(--ff-heading);
    font-size: clamp(2rem, 6vw, 3.5rem);
    line-height: 0.85;
    letter-spacing: -0.02em;
    color: var(--white);
    position: relative;
    z-index: 1;
    margin: 0;
}

.page-wordmark a {
    text-decoration: none;
    color: inherit;
}

.back-link {
    font-family: var(--ff-body);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(255,255,255,.70);
    border-bottom: 2px solid rgba(255,255,255,.35);
    padding-bottom: 2px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: color .15s ease, border-color .15s ease;
}

.back-link:hover {
    color: var(--white);
    border-color: var(--white);
}

/* ============================================================
   SHARED: PAGE BODY
   ============================================================ */

.container {
    /* body is a column flexbox; a flex item with auto margins on the
       cross axis shrink-to-fits its content instead of stretching, so
       without an explicit width every page centers a different-sized
       box and the content's left edge jumps around page to page */
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--sp-sm) var(--sp-sm);
    flex: 1;
}

.page-intro {
    font-family: var(--ff-body);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.1;
    color: var(--charcoal);
    margin-bottom: var(--sp-xl);
}

/* ============================================================
   WORK PAGE
   ============================================================ */

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--sp-md);
}

.work-card {
    background-color: var(--cream-dk);
    border-top: 5px solid var(--orange);
    padding: var(--sp-md);
}

.work-card-title {
    font-family: var(--ff-body);
    font-size: 1.4rem;
    line-height: 1.1;
    margin-bottom: var(--sp-xs);
}

.work-card-meta {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: var(--sp-sm);
}

.work-card-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.75;
}

/* ============================================================
   PHOTES PAGE
   ============================================================ */

.photo-albums {
    display: flex;
    flex-direction: column;
}

.photo-album {
    border-bottom: 1px solid var(--cream-dk);
}

.photo-album-row {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-sm) 0;
    cursor: pointer;
    list-style: none;
}

.photo-album-row::-webkit-details-marker { display: none; }
.photo-album-row::marker { content: none; }

.photo-album[open] > .photo-album-row .visit-expand-icon {
    transform: rotate(90deg);
}

.photo-album-name {
    flex: 1;
    font-family: var(--ff-heading);
    font-size: 1.1rem;
    color: var(--charcoal);
}

.photo-album-count {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: var(--teal);
    opacity: 0.7;
}

.photo-album-body {
    padding-bottom: var(--sp-md);
}

.photo-featured-wrap {
    margin-bottom: var(--sp-sm);
    background-color: var(--charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 480px;
    overflow: hidden;
}

.photo-featured {
    display: block;
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
}

.photo-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.photo-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.75;
    transition: opacity 0.1s ease, border-color 0.1s ease;
}

.photo-thumb:hover {
    opacity: 1;
    border-color: var(--orange);
}

.photo-thumb--active {
    opacity: 1;
    border-color: var(--orange);
}

/* ============================================================
   HAIKU PAGE
   ============================================================ */

article {
    margin: var(--sp-sm) 0;
}

cite {
    display: block;
    font-family: var(--ff-body);
    font-size: 0.9rem;
    color: var(--teal);
    opacity: 0.8;
    margin-top: var(--sp-xs);
    text-align: right;
}

/* ============================================================
   SHARED: Page sections (a titled block of content — a data table,
   a summary widget, etc.) Reusable across any page, not just visits.
   ============================================================ */

.page-section {
    margin: var(--sp-lg) 0;
}

.section-heading {
    font-family: var(--ff-heading);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--charcoal);
    opacity: 0.7;
    margin-bottom: var(--sp-xs);
}

dt a {
    text-decoration: none;
    transition: color 0.2s ease;
}

dt a:hover {
    color: var(--orange);
}

/* ============================================================
   VISITS PAGE
   ============================================================ */

.device-bar {
    display: flex;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--cream-dk);
}

.device-bar-segment {
    height: 100%;
    border-right: 2px solid var(--cream);
}

.device-bar-segment:last-child {
    border-right: none;
}

.device-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-sm);
    margin-top: var(--sp-xs);
    font-size: 0.85rem;
    color: var(--charcoal);
}

.device-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.device-legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.visits-list {
    display: flex;
    flex-direction: column;
}

.visit-header-row,
.visit-country-row {
    display: grid;
    grid-template-columns: 1.2rem minmax(80px, 1fr) 2.5rem repeat(2, 2.25rem) 2.75rem;
    align-items: center;
    gap: 0.6rem;
}

.visit-header-row {
    padding: 0 0 var(--sp-xs);
    border-bottom: 1px solid var(--cream-dk);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--charcoal);
    opacity: 0.55;
    align-items: end;
}

.visit-col-num {
    text-align: right;
}

/* Column labels on a 45deg angle (matching the nav ribbon's rotation) so
   narrow numeric columns don't need to be as wide as the label text */
.visit-col-heading {
    height: 3rem;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: visible;
}

.visit-col-heading span {
    display: inline-block;
    transform: rotate(-45deg);
    transform-origin: bottom left;
    white-space: nowrap;
    margin-left: 2rem;
}

.visit-country {
    border-bottom: 1px solid var(--cream-dk);
}

.visit-country-row {
    padding: var(--sp-sm) 0;
    cursor: pointer;
    list-style: none;
}

.visit-country-row::-webkit-details-marker { display: none; }
.visit-country-row::marker { content: none; }

.visit-expand-icon {
    font-size: 0.55rem;
    color: var(--orange);
    transition: transform 0.15s ease;
    flex-shrink: 0;
    display: inline-block;
}

.visit-country[open] > .visit-country-row .visit-expand-icon {
    transform: rotate(90deg);
}

.visit-country-name {
    flex: 1;
    font-family: var(--ff-heading);
    font-size: 1.1rem;
    color: var(--charcoal);
}

.visit-country-code {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--teal);
}

.visit-count {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    color: var(--orange);
    font-weight: bold;
    min-width: 4ch;
    text-align: right;
}

.visit-regions {
    margin: 0 0 var(--sp-sm) 1.4rem;
    padding-left: var(--sp-md);
    border-left: 3px solid var(--orange);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.visit-region-row {
    display: grid;
    grid-template-columns: minmax(80px, 1fr) repeat(2, 2.25rem) 2.75rem;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--charcoal);
    opacity: 0.75;
}

.visit-region-name {
    flex: 1;
}

.visit-meta {
    font-size: 0.75rem;
    color: var(--charcoal);
    opacity: 0.55;
    margin: -4px 0 var(--sp-sm) 1.4rem;
}

.visit-meta-region {
    margin: -4px 0 0 0;
    font-size: 0.7rem;
}

.recent-visits-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-visits-list li {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-sm);
    font-size: 0.9rem;
    color: var(--charcoal);
    padding: 4px 0;
    border-bottom: 1px solid var(--cream-dk);
}

.recent-visit-place {
    font-family: var(--ff-heading);
}

.recent-visit-time {
    opacity: 0.55;
    font-size: 0.8rem;
    white-space: nowrap;
}

.recent-visit-empty {
    opacity: 0.55;
    border-bottom: none !important;
}

/* ============================================================
   VISIT COUNTER
   ============================================================ */

.site-counter-footer {
    text-align: center;
    padding: var(--sp-md);
    /* extra bottom padding so the fixed-position webrung.js bar (~37px tall)
       doesn't overlap this footer's own content */
    padding-bottom: calc(var(--sp-md) + 15px);
    background-color: var(--charcoal);
}

.footer-widget {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-sm);
}

.counter-label {
    font-family: var(--ff-body);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
}

.counter-display {
    display: flex;
    gap: 2px;
    background-color: #0a0a0a;
    border: 2px inset rgba(0,0,0,0.6);
    padding: 3px 5px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.05);
}

.counter-sep {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    font-weight: bold;
    color: var(--orange-dk);
    line-height: 1;
    opacity: 0.6;
}


.counter-digit {
    display: inline-block;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    font-weight: bold;
    color: var(--orange);
    width: 1ch;
    text-align: center;
    text-shadow: 0 0 8px var(--orange), 0 0 2px var(--orange-dk);
    line-height: 1;
}

.admin-exit {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--orange);
    text-shadow: 0 0 8px var(--orange), 0 0 2px var(--orange-dk);
    text-decoration: none;
    letter-spacing: 0.2em;
    line-height: 1;
}

.theme-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--orange);
    text-shadow: 0 0 8px var(--orange), 0 0 2px var(--orange-dk);
    background-color: #0a0a0a;
    border: 2px inset rgba(0,0,0,0.6);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.05);
    padding: 3px 8px;
    cursor: pointer;
}

.theme-select option {
    background-color: #0a0a0a;
    color: var(--orange);
    text-shadow: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .home-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .brand-panel {
        min-height: 42vh;
        padding: var(--sp-md);
    }

    .brand-panel::before {
        width: 300px;
        height: 300px;
        border-width: 38px;
        bottom: -120px;
        right: -100px;
    }

    .brand-panel::after {
        width: 100px;
        height: 100px;
        border-width: 18px;
        top: var(--sp-md);
        right: var(--sp-md);
    }

    .brand-wordmark {
        font-size: clamp(3rem, 12vw, 5rem);
    }

    .content-panel {
        padding: var(--sp-md);
    }

    .branding-header {
        padding: var(--sp-sm) var(--sp-md);
        flex-wrap: wrap;
    }

    .container {
        margin: var(--sp-lg) auto 0;
        padding: 0 var(--sp-md) var(--sp-lg);
    }

    .work-grid {
        grid-template-columns: 1fr;
    }

    /* Diagonal column headers + narrower numeric columns fit most phones
       natively now; keep a scroll fallback just in case a very narrow
       viewport or long country name still doesn't have room */
    .visits-list {
        overflow-x: auto;
    }
}

@media (max-width: 420px) {
    .brand-wordmark {
        font-size: clamp(2.5rem, 13vw, 4rem);
    }
}
