/* ============================================================
   MORTRION.ORG — Documentation-style knowledge base
   Theme: Energy-efficient home lighting (Polish)
   ============================================================ */

/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --col-bg:           #f7f8fa;
    --col-surface:      #ffffff;
    --col-border:       #dde1e7;
    --col-text:         #1c2329;
    --col-text-muted:   #5a6472;
    --col-primary:      #1a5f7a;
    --col-primary-dark: #134f66;
    --col-primary-light:#e8f4f8;
    --col-accent:       #d4860e;
    --col-accent-light: #fdf3e3;
    --col-green:        #2e7d32;
    --col-green-light:  #e8f5e9;
    --col-link:         #1a5f7a;
    --col-link-hover:   #d4860e;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

    --sidebar-width: 260px;
    --header-height: 60px;
    --content-max:  780px;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.10);
}

/* ── Base ── */
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-sans);
    background: var(--col-bg);
    color: var(--col-text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--col-link); text-decoration: none; }
a:hover { color: var(--col-link-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5rem; }

/* ── Skip link ── */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    padding: .5rem 1rem;
    background: var(--col-primary);
    color: #fff;
    z-index: 9999;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--col-primary);
    box-shadow: var(--shadow-md);
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.25rem;
    max-width: calc(var(--sidebar-width) + var(--content-max) + 4rem);
    margin: 0 auto;
}

.header-brand { display: flex; align-items: center; gap: 1rem; }

.brand-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -.3px;
    text-decoration: none;
}
.brand-link:hover { color: #fff; text-decoration: none; opacity: .9; }
.brand-icon { font-size: 1.4rem; }
.brand-tagline {
    color: rgba(255,255,255,.72);
    font-size: .78rem;
    display: none;
}

@media (min-width: 768px) {
    .brand-tagline { display: block; }
}

/* ── Nav toggle ── */
.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
    border-radius: var(--radius-sm);
}
.nav-toggle:hover { background: rgba(255,255,255,.15); }
.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 960px) { .nav-toggle { display: none; } }

/* ── Layout ── */
.layout-wrapper {
    display: flex;
    flex: 1;
    max-width: calc(var(--sidebar-width) + var(--content-max) + 4rem);
    margin: 0 auto;
    width: 100%;
    align-items: flex-start;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--col-surface);
    border-right: 1px solid var(--col-border);
    min-height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    display: none;
}

@media (min-width: 960px) { .sidebar { display: block; } }

.sidebar.is-open { display: block; position: fixed; top: var(--header-height); left: 0; bottom: 0; z-index: 90; box-shadow: var(--shadow-md); }

.sidebar-nav { padding: 1.25rem .75rem; }
.sidebar-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--col-text-muted);
    padding: 0 .5rem .5rem;
    display: block;
}

.sidebar-list { list-style: none; padding: 0; }
.sidebar-item { margin-bottom: 2px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    border-radius: var(--radius-sm);
    color: var(--col-text);
    font-size: .9rem;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.sidebar-link:hover { background: var(--col-primary-light); color: var(--col-primary); text-decoration: none; }
.sidebar-item.is-active .sidebar-link { background: var(--col-primary); color: #ffffff; font-weight: 600; }
.sidebar-item.is-active .sidebar-link:hover { background: var(--col-primary-dark); }

.sidebar-icon { font-size: 1rem; width: 1.2rem; text-align: center; flex-shrink: 0; }
.sidebar-text { flex: 1; }

/* ── Main content ── */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 1.25rem 3rem;
    max-width: var(--content-max);
}

@media (min-width: 960px) {
    .main-content { padding: 2.5rem 2rem 4rem; }
}

/* ── Breadcrumb ── */
.breadcrumb {
    margin-bottom: 1.5rem;
}
.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    gap: .25rem;
    font-size: .82rem;
    color: var(--col-text-muted);
}
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before { content: '›'; margin-right: .25rem; color: var(--col-text-muted); }
.breadcrumb a { color: var(--col-text-muted); }
.breadcrumb a:hover { color: var(--col-link-hover); }
.breadcrumb [aria-current="page"] { color: var(--col-text); font-weight: 500; }

/* ── Article header ── */
.article-header { margin-bottom: 2rem; }
.article-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--col-accent);
    margin-bottom: .5rem;
    display: block;
}
.article-header h1 {
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--col-text);
    margin-bottom: .6rem;
}
.article-lead {
    font-size: 1.05rem;
    color: var(--col-text-muted);
    line-height: 1.65;
    max-width: 65ch;
    margin-bottom: 1.2rem;
}

/* ── TOC ── */
.toc {
    background: var(--col-primary-light);
    border-left: 3px solid var(--col-primary);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}
.toc-title {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--col-primary);
    margin-bottom: .6rem;
}
.toc ol { padding-left: 1.2rem; }
.toc li { font-size: .9rem; margin-bottom: .3rem; }
.toc a { color: var(--col-primary); }
.toc a:hover { color: var(--col-accent); }

/* ── Article typography ── */
.article-body { max-width: 68ch; }

.article-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--col-text);
    margin: 2.2rem 0 .9rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--col-border);
}
.article-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--col-text);
    margin: 1.6rem 0 .6rem;
}
.article-body p { margin-bottom: 1rem; }
.article-body ul, .article-body ol { margin-bottom: 1rem; }
.article-body li { margin-bottom: .35rem; }

.article-body strong { color: var(--col-text); font-weight: 600; }
.article-body code {
    font-family: var(--font-mono);
    font-size: .88em;
    background: #f0f3f6;
    padding: .15em .4em;
    border-radius: var(--radius-sm);
    color: #c0392b;
}

/* ── Images inside articles ── */
.article-image {
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--col-border);
}
.article-image img {
    width: 100%;
    object-fit: cover;
    max-height: 380px;
}
.article-image figcaption {
    font-size: .78rem;
    color: var(--col-text-muted);
    padding: .5rem .75rem;
    background: var(--col-bg);
    border-top: 1px solid var(--col-border);
}

/* ── Comparison table ── */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: .9rem;
    overflow-x: auto;
    display: block;
}
.compare-table th {
    background: var(--col-primary);
    color: #ffffff;
    text-align: left;
    padding: .65rem .85rem;
    font-weight: 600;
    white-space: nowrap;
}
.compare-table td {
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--col-border);
    vertical-align: top;
}
.compare-table tr:nth-child(even) td { background: var(--col-bg); }
.compare-table tr:hover td { background: var(--col-primary-light); }

/* ── Highlight boxes ── */
.info-box {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    border-left: 4px solid;
    font-size: .92rem;
}
.info-box.note { background: var(--col-primary-light); border-color: var(--col-primary); }
.info-box.tip  { background: var(--col-green-light); border-color: var(--col-green); }
.info-box.warn { background: var(--col-accent-light); border-color: var(--col-accent); }
.info-box p:last-child { margin-bottom: 0; }
.info-box strong { display: block; margin-bottom: .3rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }

/* ── Collapsible FAQ ── */
.faq-list { margin: 1rem 0; }
.faq-item { border: 1px solid var(--col-border); border-radius: var(--radius-md); margin-bottom: .5rem; overflow: hidden; }
.faq-item summary {
    padding: .9rem 1.1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: .95rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--col-surface);
    transition: background .15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--col-primary); flex-shrink: 0; margin-left: .5rem; }
.faq-item[open] summary { background: var(--col-primary-light); }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { background: var(--col-primary-light); }
.faq-answer { padding: 1rem 1.1rem; font-size: .92rem; color: var(--col-text-muted); border-top: 1px solid var(--col-border); }
.faq-answer p:last-child { margin-bottom: 0; }

/* ── Spec list ── */
.spec-list { list-style: none; padding: 0; margin: 1rem 0; }
.spec-list li {
    display: flex;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px dashed var(--col-border);
    font-size: .9rem;
    align-items: baseline;
}
.spec-list li:last-child { border-bottom: none; }
.spec-key { min-width: 180px; color: var(--col-text-muted); flex-shrink: 0; }
.spec-val { font-weight: 500; }

/* ── Related content ── */
.related-content {
    margin: 2.5rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--col-border);
}
.related-content h3 { font-size: 1rem; color: var(--col-text-muted); font-weight: 600; margin-bottom: .75rem; }
.related-content ul { list-style: none; padding: 0; }
.related-content li { margin-bottom: .4rem; }
.related-content a { font-size: .92rem; color: var(--col-link); }
.related-content a:hover { color: var(--col-link-hover); }
.related-sub { color: var(--col-text-muted); font-weight: 400; }

/* ── Home — Topic grid ── */
.home-intro { margin-bottom: 2.5rem; }
.home-intro h1 {
    font-size: clamp(1.7rem, 4.5vw, 2.4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: .75rem;
}
.home-intro p { font-size: 1.05rem; color: var(--col-text-muted); max-width: 60ch; }

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.topic-card {
    background: var(--col-surface);
    border: 1px solid var(--col-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}
.topic-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.topic-card-img {
    height: 160px;
    overflow: hidden;
    flex-shrink: 0;
}
.topic-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.topic-card:hover .topic-card-img img { transform: scale(1.04); }

.topic-card-body { padding: 1rem 1.1rem; flex: 1; display: flex; flex-direction: column; }
.topic-card h2 { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.topic-card h2 a { color: var(--col-text); text-decoration: none; }
.topic-card h2 a:hover { color: var(--col-primary); }
.topic-card-sub { font-size: .78rem; color: var(--col-accent); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: .5rem; }
.topic-card p { font-size: .87rem; color: var(--col-text-muted); flex: 1; }

.topic-card-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .85rem;
    font-size: .83rem;
    font-weight: 600;
    color: var(--col-primary);
    text-decoration: none;
}
.topic-card-link:hover { color: var(--col-accent); text-decoration: none; }
.topic-card-link::after { content: '→'; transition: transform .15s; }
.topic-card:hover .topic-card-link::after { transform: translateX(3px); }

/* ── Kelvin bar ── */
.kelvin-bar {
    display: flex;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 1.25rem 0;
    font-size: .8rem;
    font-weight: 600;
}
.kelvin-segment { flex: 1; padding: .65rem .5rem; text-align: center; color: #fff; min-width: 0; }
.kelvin-segment small { display: block; font-size: .7rem; font-weight: 400; opacity: .85; }
.ks-1800  { background: #ff6a00; }
.ks-2700  { background: #e8820a; }
.ks-3000  { background: #d4921c; }
.ks-4000  { background: #b0a830; color: #1c2329; }
.ks-5000  { background: #7dbc4e; color: #1c2329; }
.ks-6500  { background: #5a9fd8; }

/* ── Energy comparison bars ── */
.energy-compare { margin: 1.5rem 0; }
.ec-row { margin-bottom: .75rem; }
.ec-label { font-size: .88rem; margin-bottom: .25rem; display: flex; justify-content: space-between; }
.ec-bar-bg { background: var(--col-border); border-radius: 4px; overflow: hidden; height: 22px; }
.ec-bar { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: .5rem; font-size: .75rem; font-weight: 700; color: #fff; transition: width .5s ease; }
.ec-led       { background: #2e7d32; }
.ec-cfl       { background: #1565c0; }
.ec-halogen   { background: #e65100; }
.ec-incand    { background: #b71c1c; }

/* ── Footer ── */
.site-footer {
    background: var(--col-text);
    color: rgba(255,255,255,.8);
    margin-top: auto;
    font-size: .85rem;
}
.footer-inner {
    max-width: calc(var(--sidebar-width) + var(--content-max) + 4rem);
    margin: 0 auto;
    padding: 2rem 1.25rem 1.25rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
.footer-name { font-weight: 700; color: #fff; margin-bottom: .3rem; }
.footer-desc { color: rgba(255,255,255,.55); line-height: 1.5; }
.footer-nav ul { list-style: none; padding: 0; columns: 2; }
.footer-nav li { margin-bottom: .3rem; }
.footer-nav a { color: rgba(255,255,255,.65); }
.footer-nav a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    max-width: calc(var(--sidebar-width) + var(--content-max) + 4rem);
    margin: 0 auto;
    padding: .9rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: space-between;
    font-size: .78rem;
    color: rgba(255,255,255,.45);
}
.footer-bottom a { color: rgba(255,255,255,.55); }
.footer-bottom a:hover { color: #fff; }

/* ── Overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: rgba(0,0,0,.35);
    z-index: 89;
}
.sidebar-overlay.is-visible { display: block; }

/* ── Utilities ── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Responsive ── */
@media (max-width: 959px) {
    .layout-wrapper { display: block; }
    .main-content { padding: 1.5rem 1rem 2.5rem; }
    .brand-tagline { display: none; }
}
