/* ==========================================================
   AMIGA WORKBENCH 1.3 INSPIRED STATIC SITE
   ----------------------------------------------------------
   Layout:
   - visible desktop background
   - large content window on the left
   - vertical icon stack on the right
   - HTML + CSS only
   ========================================================== */

:root {
    --wb-blue: #0057ad;
    --wb-blue-dark: #002d75;
    --wb-blue-deep: #001759;
    --wb-white: #f5f5f5;
    --wb-black: #00103f;
    --wb-orange: #f79b00;
    --wb-shadow: #000a2d;
    --desktop-width: 1220px;
    --icon-column-width: 205px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

html {
    background: var(--wb-blue);
}

body {
    background: var(--wb-blue);
    color: var(--wb-white);
    font-family: "Courier New", Courier, monospace;
    font-size: 17px;
    line-height: 1.42;
    font-weight: 700;
}

a {
    color: var(--wb-white);
    text-decoration: underline;
}

a:hover,
a:focus {
    color: var(--wb-orange);
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- top bar ---------- */

.topbar {
    background: var(--wb-white);
    border-bottom: 2px solid var(--wb-blue-dark);
}

.topbar-inner {
    width: calc(100% - 12px);
    margin: 0 auto;
    padding: 5px 8px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar-link,
.memory {
    color: var(--wb-blue);
    text-decoration: none;
    font-size: 1.03rem;
    letter-spacing: 0.01em;
}

.topbar-link:hover,
.topbar-link:focus {
    color: var(--wb-blue-dark);
    text-decoration: underline;
    background: transparent;
}

/* ---------- desktop layout ---------- */

.desktop {
    width: min(var(--desktop-width), calc(100% - 24px));
    margin: 0 auto;
    padding: 28px 0 30px;
}

.desktop-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--icon-column-width);
    gap: 28px;
    align-items: start;
}

.main-window-wrap {
    min-width: 0;
}

/* ---------- workbench window ---------- */

.window {
    background: var(--wb-blue);
    border: 2px solid var(--wb-white);
    box-shadow: 4px 4px 0 rgba(0, 14, 60, 0.72);
}

.window-titlebar {
    position: relative;
    min-height: 38px;
    padding: 6px 86px 6px 38px;
    background: var(--wb-white);
    color: var(--wb-blue);
    border-bottom: 2px solid var(--wb-blue-dark);
}

.window-appicon {
    position: absolute;
    left: 7px;
    top: 7px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--wb-blue);
    background: var(--wb-white);
}

.window-appicon::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 8px;
    height: 8px;
    background: var(--wb-blue-dark);
}

.window-title {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--wb-blue);
    font-size: 1.02rem;
    line-height: 1.35;
    padding-top: 1px;
}

.window-title-lines {
    position: absolute;
    left: 206px;
    right: 68px;
    top: 12px;
    height: 14px;
    border-top: 2px solid var(--wb-blue);
    border-bottom: 2px solid var(--wb-blue);
    background:
        repeating-linear-gradient(
            to right,
            var(--wb-blue) 0 9px,
            transparent 9px 12px
        );
}

.window-gadget,
.window-depth {
    position: absolute;
    top: 7px;
    width: 22px;
    height: 22px;
    background: var(--wb-white);
    border: 2px solid var(--wb-blue);
}

.window-gadget {
    right: 35px;
}

.window-depth {
    right: 8px;
}

.window-gadget::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 12px;
    height: 12px;
    background: var(--wb-blue-dark);
}

.window-depth::before,
.window-depth::after {
    content: "";
    position: absolute;
    border: 2px solid var(--wb-blue-dark);
    background: var(--wb-white);
}

.window-depth::before {
    left: 3px;
    top: 6px;
    width: 10px;
    height: 8px;
}

.window-depth::after {
    left: 6px;
    top: 3px;
    width: 10px;
    height: 8px;
}

.window-content {
    padding: 18px 20px 22px;
    color: var(--wb-white);
}

.window-content > :first-child {
    margin-top: 0;
}

.window-content > :last-child {
    margin-bottom: 0;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--wb-white);
    line-height: 1.2;
}

h1 {
    font-size: 1.95rem;
    margin-bottom: 0.7rem;
}

h2 {
    font-size: 1.38rem;
    margin-bottom: 0.35rem;
}

h3 {
    font-size: 1.08rem;
}

p,
li {
    color: var(--wb-white);
}

ul {
    padding-left: 1.2em;
}

.info-box {
    margin: 18px 0;
    padding: 10px 12px;
    border: 2px solid var(--wb-white);
    color: var(--wb-white);
}


/* ---------- spacing between stacked content windows ---------- */

.main-window-wrap > .window + .window {
    margin-top: 28px;
}

/* ---------- right icon column ---------- */

.icon-column {
    padding-top: 8px;
}

.icon-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.wb-icon {
    display: block;
    width: 100%;
    max-width: 180px;
    padding: 0 6px;
    background: transparent;
    color: var(--wb-white);
    text-align: center;
    text-decoration: none;
}

.wb-icon:hover,
.wb-icon:focus {
    background: transparent;
    color: var(--wb-white);
}

.wb-icon-picture {
    display: flex;
    width: 100px;
    height: 72px;
    margin: 0 auto 6px;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.wb-icon-picture img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: fill;

    /* Keep the original pixel-art look while intentionally
       stretching all icons to the same Workbench icon height. */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.wb-icon-label {
    display: inline-block;
    padding: 2px 6px 1px;
    color: var(--wb-white);
    line-height: 1.15;
    text-decoration: none;
}

.wb-icon.current .wb-icon-label,
.wb-icon:hover .wb-icon-label,
.wb-icon:focus .wb-icon-label {
    background: var(--wb-white);
    color: var(--wb-blue);
}

/* ---------- button links ---------- */

.button-link {
    display: inline-block;
    margin: 4px 8px 4px 0;
    padding: 5px 10px;
    background: var(--wb-white);
    color: var(--wb-blue);
    border: 2px solid var(--wb-blue-dark);
    text-decoration: none;
}

.button-link:hover,
.button-link:focus {
    background: var(--wb-orange);
    color: var(--wb-blue-dark);
}

/* ---------- blog ---------- */

.blog-entry {
    padding: 0 0 16px;
    margin: 0 0 16px;
    border-bottom: 2px dotted rgba(255,255,255,0.9);
}

.blog-entry:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.blog-entry h2 {
    margin-bottom: 0.2rem;
}

.blog-entry h2 a {
    color: var(--wb-white);
}

.blog-entry h2 a:hover,
.blog-entry h2 a:focus {
    color: var(--wb-orange);
}

.date {
    margin-top: 0;
    color: #d8e5ff;
    font-size: 0.92rem;
}

/* ---------- gallery ---------- */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 18px;
}

.gallery figure {
    margin: 0;
    padding: 8px;
    border: 2px solid var(--wb-white);
}

.gallery-link {
    display: block;
    padding: 3px;
    background: var(--wb-white);
    border: 2px solid var(--wb-blue-dark);
    line-height: 0;
    text-decoration: none;
}

.gallery-link:hover,
.gallery-link:focus {
    background: var(--wb-orange);
}

.gallery-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: var(--wb-blue-dark);
}

.gallery figcaption {
    padding-top: 8px;
    color: var(--wb-white);
    font-size: 0.94rem;
    line-height: 1.35;
}

/* ---------- columns ---------- */

.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ---------- footer ---------- */

.footer {
    width: min(var(--desktop-width), calc(100% - 24px));
    margin: 0 auto;
    padding: 0 0 24px;
    color: var(--wb-white);
    font-size: 0.9rem;
}

/* ---------- 404 ---------- */

.guru-page {
    background: #040404;
}

.guru-page .topbar {
    background: #040404;
    border-bottom: 0;
}

.guru-page .topbar-link,
.guru-page .memory,
.guru-page .footer,
.guru-page .window-content,
.guru-page h1,
.guru-page p {
    color: #e62020;
}

.guru-page .window {
    background: #040404;
    border-color: #e62020;
    box-shadow: none;
}

.guru-page .window-titlebar {
    background: #040404;
    color: #e62020;
    border-bottom-color: #e62020;
}

.guru-page .window-appicon {
    border-color: #e62020;
    background: #040404;
}

.guru-page .window-appicon::after {
    background: #e62020;
}

.guru-page .window-title {
    color: #e62020;
}

.guru-page .window-title-lines {
    border-top-color: #e62020;
    border-bottom-color: #e62020;
    background: repeating-linear-gradient(
        to right,
        #e62020 0 9px,
        transparent 9px 12px
    );
}

.guru-page .window-gadget,
.guru-page .window-depth {
    border-color: #e62020;
    background: #040404;
}

.guru-page .window-gadget::after {
    background: #e62020;
}

.guru-page .window-depth::before,
.guru-page .window-depth::after {
    border-color: #e62020;
    background: #040404;
}

.guru-page .button-link {
    background: #040404;
    color: #e62020;
    border-color: #e62020;
}

.guru-page .button-link:hover,
.guru-page .button-link:focus {
    background: #e62020;
    color: #040404;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
    .desktop-grid {
        grid-template-columns: 1fr;
    }

    .icon-column {
        order: -1;
        padding-top: 0;
    }

    .icon-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px 8px;
    }

    .wb-icon {
        width: 140px;
    }
}

@media (max-width: 760px) {
    body {
        font-size: 16px;
    }

    .topbar-inner {
        flex-wrap: wrap;
    }

    .window-title-lines {
        display: none;
    }

    .window-titlebar {
        padding-right: 68px;
    }

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

@media (max-width: 540px) {
    .desktop,
    .footer {
        width: calc(100% - 16px);
    }

    .window-content {
        padding: 14px;
    }

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

    .icon-list {
        justify-content: space-between;
    }

    .wb-icon {
        width: calc(50% - 8px);
        max-width: none;
    }
}


/* ==========================================================
   WORKBENCH-LIKE CONTENT VIEWS
   Blog, Photos and Links now look like contents of open drawers
   instead of modern website sections.
   ========================================================== */

/* Small status line inside a Workbench window */
.drawer-status {
    margin: -4px 0 16px;
    padding: 4px 7px;
    color: var(--wb-white);
    border-bottom: 2px solid rgba(255,255,255,0.82);
    font-size: 0.9rem;
}

/* ---------- Blog: file/list view ---------- */

.wb-list {
    border-top: 2px solid var(--wb-white);
}

.wb-list-row {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
    padding: 11px 8px 10px;
    border-bottom: 2px dotted rgba(255,255,255,0.9);
    align-items: start;
}

.wb-list-row:last-child {
    border-bottom: 0;
}

.wb-list-date {
    color: #d7e5ff;
    font-size: 0.88rem;
    white-space: nowrap;
}

.wb-list-main {
    min-width: 0;
}

.wb-list-title {
    display: inline-block;
    margin-bottom: 4px;
    color: var(--wb-white);
    text-decoration: none;
}

.wb-list-title::before {
    content: "▣ ";
    color: var(--wb-orange);
}

.wb-list-title:hover,
.wb-list-title:focus {
    color: var(--wb-blue);
    background: var(--wb-white);
}

.wb-list-description {
    margin: 0;
    color: var(--wb-white);
    font-size: 0.94rem;
}

/* ---------- Photos: Workbench icon view ---------- */

.photo-drawer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 22px 16px;
    align-items: start;
}

.photo-item {
    margin: 0;
    min-width: 0;
    text-align: center;
}

.photo-item a {
    display: block;
    color: var(--wb-white);
    text-decoration: none;
}

.photo-preview {
    display: flex;
    width: 138px;
    height: 100px;
    margin: 0 auto 7px;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: var(--wb-white);
    border: 2px solid var(--wb-blue-dark);
    box-shadow: 3px 3px 0 var(--wb-blue-deep);
}

.photo-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-name {
    display: inline-block;
    max-width: 150px;
    padding: 2px 5px 1px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.photo-item a:hover .photo-name,
.photo-item a:focus .photo-name {
    color: var(--wb-blue);
    background: var(--wb-white);
}

.photo-item a:hover .photo-preview,
.photo-item a:focus .photo-preview {
    background: var(--wb-orange);
}

/* ---------- Links: Workbench object rows ---------- */

.link-drawer {
    border-top: 2px solid var(--wb-white);
}

.link-object {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 8px;
    border-bottom: 2px dotted rgba(255,255,255,0.9);
    align-items: center;
}

.link-object:last-child {
    border-bottom: 0;
}

.link-object-icon {
    position: relative;
    width: 42px;
    height: 30px;
    background: var(--wb-white);
    border: 2px solid var(--wb-blue-dark);
    box-shadow: 3px 3px 0 var(--wb-blue-deep);
}

.link-object-icon::before {
    content: "";
    position: absolute;
    left: 5px;
    top: -7px;
    width: 27px;
    height: 8px;
    background: var(--wb-white);
    border: 2px solid var(--wb-blue-dark);
    border-bottom: 0;
}

.link-object a {
    display: inline-block;
    color: var(--wb-white);
    text-decoration: none;
}

.link-object a:hover,
.link-object a:focus {
    color: var(--wb-blue);
    background: var(--wb-white);
}

.link-object p {
    margin: 3px 0 0;
    font-size: 0.92rem;
    color: #d7e5ff;
}

/* Keep the large content window roomy, like an open Workbench drawer */
.page-blog .window-content,
.page-photos .window-content,
.page-links .window-content {
    min-height: 470px;
}

@media (max-width: 680px) {
    .wb-list-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .photo-drawer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-preview {
        width: 120px;
        height: 88px;
    }
}

@media (max-width: 430px) {
    .photo-drawer {
        grid-template-columns: 1fr;
    }
}
