/* ===================================
   LAYOUT.CSS - DevPanicZone
   ===================================   
   Table of Contents
   -----------------
   1. MAIN CONTENT ..................... ~25
   2. HEADER ........................... ~35
   3. FOOTER ........................... ~55
   4. CONTAINER ........................ ~95
   5. SECTIONS (Categories) ............ ~115
   6. GRID SYSTEMS ..................... ~125
      6.1 Categories Grid .............. ~130
      6.2 Grid-3 (Auto-fit) ............ ~150
      6.3 Grid-4 (1-4 Spalten) ......... ~180
      6.4 Grid-2col .................... ~215
      6.5 Grid-2-1col (2:1 Ratio) ...... ~282
      6.6 Grid-2col-cards .............. ~300
      6.7 Code-Block Header/Footer ..... ~346
      6.8 Tutorials Grid ............... ~379
      6.9 Responsive icon-grid-res ..... ~397
      6.10 Mobile First icon-grid ...... ~425

   =================================== */


/* ===================================
   1. MAIN CONTENT
   =================================== */

.site-main {
    flex: 1;
}


/* ===================================
   2. HEADER
   =================================== */

.site-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0px;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    height: 60px;
    gap: 1rem;
}


/* ===================================
   3. FOOTER
   =================================== */

.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 150ms ease;
}

.footer-nav a:hover {
    color: var(--accent-blue);
}


/* ===================================
   4. CONTAINER
   =================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 4rem;
    }
}


/* ===================================
   5. SECTIONS (Categories)
   =================================== */

.categories {
    margin: 0;
    padding: 2rem 0;
}


/* ===================================
   6. GRID SYSTEMS
   =================================== */

/* ----- 6.1 Categories Grid ----- */

.categories-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

/* 640px: 2 Spalten */
@media (min-width: 640px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 1024px: 3 Spalten */
@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ----- 6.2 Grid-3 (Auto-fit) ----- */

/* Basis: Mobile = 1 Spalte */
.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Tablet: Mindestens 2 Spalten (ab ~350px pro Item) */
@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

/* Desktop: Spalten passen sich an (3-4 Spalten je nach Breite) */
@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.grid-item {
    padding: 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
}


/* ----- 6.3 Grid-4 (1-4 Spalten) ----- */

/* Basis: Mobile = 1 Spalte */
.grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.grid-3 h4,
.grid-4 h4 {
    padding-top: 0.5rem;
}

/* Tablet: 2 Spalten */
@media (min-width: 768px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 Spalten */
@media (min-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop: 4 Spalten */
@media (min-width: 1440px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ----- 6.4 Grid-2col ----- */

/* Generisches 2-Spalten Grid */
.grid-2col {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    align-items: stretch;
    margin: 0;
}

.grid-2col .info-box {
    margin-bottom: 0;
}

.grid-2col>.code-block {
    margin: auto 0 0 0;
}

.grid-2col-bg h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding: 0.5rem 0 0;
}

/* .grid-2col .arrow-list,
.grid-2col-bg .arrow-list,*/
/* .grid-2col .check-list,
.grid-2col-bg .check-list,
.grid-2col .cross-list,
.grid-2col-bg .cross-list {
    margin: 0;
    padding-left: 1.5rem;
} */

.arrow-list.grid-2col-bg {
    padding-left: 1.5rem;
    margin: 0;
}

.grid-2col ol,
.grid-2col-bg ol {
    margin: 0;
}

/* 640px: 2 Spalten */
@media (min-width: 640px) {
    .grid-2col {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- Background Styling Grid ---- */
.grid-2col-bg {
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* ----- 6.5 Grid-2-1col (2:1 Verhältnis) ----- */
/* Linke Spalte 2x so breit wie rechte */

.grid-2-1col {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    align-items: center;
}

/* 640px: 2:1 Verhältnis */
@media (min-width: 640px) {
    .grid-2-1col {
        grid-template-columns: 2fr 1fr;
    }
}


/* ----- 6.6 Grid-2col-cards ----- */
/* Grid für gleich hohe Cards/Code-Blocks */

.grid-2col-cards {
    display: grid;
    gap: 1.5rem;
    margin: 1rem 0;
    grid-template-columns: 1fr;
    align-items: stretch;
}

.grid-2col-cards h4 {
    padding: 15px 0 10px;
}

/* Code-Blocks in diesem Grid zu Flex-Containern machen */
.grid-2col-cards>.code-block {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Content-Bereich soll wachsen und restlichen Platz füllen */
.grid-2col-cards>.code-block>div:not(.code-header) {
    flex: 1;
}

.grid-2col-cards>.grid-2col-bg {
    min-width: 0;
}

.grid-2col-cards .code-block {
    min-width: 0;
}

.grid-2col-cards .code-block pre {
    min-width: 0;
    white-space: pre;
}

@media (min-width: 1040px) {
    .grid-2col-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ----- 6.7 Code-Block Header/Footer ----- */

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.code-footer {
    padding: 1rem 1.5rem;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    /* MERGED: war vorher separate Regel */
}

.code-footer p {
    margin: 0.5rem 0;
}

.code-footer p:first-child {
    margin-top: 0;
}

.code-footer p:last-child {
    margin-bottom: 0;
}

/* ----- 6.8 Tutorials Grid (Latest Tutorials) ----- */

.tutorials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Desktop: 2 Spalten nebeneinander */
@media (min-width: 768px) {
    .tutorials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ----- 6.9 Responsive icon-grid-res ----- */
.icon-grid-res {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.icon-grid-res .group-res h4 {
    margin: 0;
    padding: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--heading-secondary);
}

.icon-grid-res .group-res p {
    margin: 0;
    line-height: 1.6;
    font-size: 1.15rem;
}

.group-res {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

/* 6.10 Mobile First icon-grid */
.icon-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* auf Handy: alles untereinander */
    gap: 1.5rem;
    margin: 2rem 0;
}

.group {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.icon-grid .group h4 {
    margin: 0 0 0.4rem;
    padding: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #555;
}

.icon-grid .group p {
    margin: 0;
    line-height: 1.6;
    font-size: 1.15rem;
}

/* TABLET */
@media (min-width: 600px) {
    .icon-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* DESKTOP */
@media (min-width: 900px) {
    .icon-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* BREITE DESKTOPS */
@media (min-width: 1200px) {
    .icon-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}