# CSS Responsive Modernization Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Modernize all theme CSS files to use a consistent mobile-first breakpoint system with ascending `min-width` queries, eliminating `max-width` queries, compound ranges, and near-duplicate breakpoints.

**Architecture:** Mobile-first CSS with 4 consolidated breakpoints (640px, 1025px, 1280px, 1536px). Base styles target mobile, each ascending `min-width` query progressively enhances. All animations and transitions remain untouched.

**Tech Stack:** CSS (vanilla), Drupal 11 theme (`kaindl_theme`)

**Spec:** `docs/superpowers/specs/2026-03-31-css-responsive-modernization-design.md`

---

## File Map

| File | Action | Responsibility |
|------|--------|---------------|
| `css/variables.css` | Modify | Add breakpoint documentation tokens |
| `css/header.css` | Rewrite media queries | Header, branding, lang selector, compact state |
| `css/navigation.css` | Rewrite media queries | Desktop nav, mobile sidebar, breadcrumbs |
| `css/megamenu.css` | Rewrite media queries | Megamenu overlay, media panel, stagger animations |
| `css/layout.css` | Rewrite media queries | Grid layouts, sidebar collapse |
| `css/footer.css` | Rewrite media queries | Footer grid, bottom bar |
| `css/home.css` | Rewrite media queries | Hero, content sections, teasers |
| `css/page-header.css` | Rewrite media queries | Inner page header, controls |

---

## Breakpoint Reference

```
Base         = mobile (< 640px)
bp-sm        = 640px   (small tablet+)
bp-md        = 1025px  (desktop)
bp-lg        = 1280px  (wide desktop)
bp-xl        = 1536px  (full-width)
```

**Merge map for each task:**
- `max-width: 575px` / `max-width: 639px` / `max-width: 640px` → base styles (no query)
- `max-width: 860px` / `max-width: 899px` → base styles, override at `min-width: 640px`
- `max-width: 1024px` → base styles, override at `min-width: 1025px`
- `max-width: 1180px` / `max-width: 1199px` / `max-width: 1280px` / `max-width: 1299px` / `max-width: 1300px` → set in `1025px`, override at `min-width: 1280px`
- `max-width: 1400px` / `max-width: 1420px` / `max-width: 1440px` / `max-width: 1500px` / `max-width: 1536px` → set in `1025px` or `1280px`, override at `min-width: 1536px`
- `min-width: 1025px and max-width: X` compound → split into ascending `min-width` blocks
- `min-width: 1680px` → merge into `min-width: 1536px`

---

### Task 1: Take baseline screenshots for regression testing

**Files:**
- Create: `docs/superpowers/screenshots/` (directory for baseline images)

**Why:** Before any CSS changes, capture the current state at all key widths so we can compare after each task.

- [ ] **Step 1: Navigate to the live site**

Navigate to `https://kaindl.dev.creatizmo.com/en` in the browser.

- [ ] **Step 2: Take baseline screenshots at each breakpoint width**

Take full-page screenshots at these widths (height 900px for viewport shots):
- 375px (mobile)
- 768px (tablet)
- 1024px (mobile/desktop boundary)
- 1280px (wide desktop)
- 1920px (full desktop)

Save each to `docs/superpowers/screenshots/baseline-{width}.jpg`.

- [ ] **Step 3: Also capture the megamenu open state at 1920px and 1280px**

Hover over "BOARDS" nav item and screenshot the megamenu at 1920px and 1280px.
Save as `docs/superpowers/screenshots/baseline-megamenu-{width}.jpg`.

---

### Task 2: Add breakpoint documentation to variables.css

**Files:**
- Modify: `web/themes/custom/kaindl_theme/css/variables.css`

- [ ] **Step 1: Add breakpoint documentation block**

Add the following comment block at the end of the `:root` block in `variables.css`, before the closing `}`:

```css
  /*
   * Responsive breakpoints (ascending mobile-first).
   * CSS media queries cannot use custom properties, so these are documented
   * here as the single source of truth. All CSS files MUST use only these values.
   *
   * Base       : mobile-first (no query)
   * bp-sm      : 640px   — small tablet and up
   * bp-md      : 1025px  — desktop (matches JS DESKTOP_HEADER_MEDIA_QUERY)
   * bp-lg      : 1280px  — wide desktop
   * bp-xl      : 1536px  — full-width desktop
   *
   * Usage:
   *   @media (min-width: 640px)  { ... }
   *   @media (min-width: 1025px) { ... }
   *   @media (min-width: 1280px) { ... }
   *   @media (min-width: 1536px) { ... }
   *
   * NEVER use max-width for layout breakpoints.
   * NEVER use compound queries like (min-width: X) and (max-width: Y).
   */
```

- [ ] **Step 2: Commit**

```bash
git add web/themes/custom/kaindl_theme/css/variables.css
git commit -m "feat(theme): add breakpoint documentation to variables.css"
```

---

### Task 3: Refactor layout.css to mobile-first

**Files:**
- Modify: `web/themes/custom/kaindl_theme/css/layout.css`

This file has one `@media (max-width: 1024px)` block (lines 107-112) and one `@media (min-width: 1280px)` block (line 276) which is already correct. The interaction queries (`hover:hover`, `hover:none`) are fine and stay untouched.

- [ ] **Step 1: Convert the sidebar grid collapse to mobile-first**

Current code (lines 107-112):
```css
@media (max-width: 1024px) {
  .layout-main__grid--two-sidebars,
  .layout-main__grid--one-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }
}
```

The base styles (lines 75-84) set multi-column grids. In mobile-first, the base should be single-column (mobile), and desktop should set multi-column.

Replace the grid definitions (lines 75-88) AND the `@media (max-width: 1024px)` block (lines 107-112) with:

```css
.layout-main__grid--two-sidebars,
.layout-main__grid--one-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

.layout-main__grid--no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1025px) {
  .layout-main__grid--two-sidebars {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(
        220px,
        280px
      );
  }

  .layout-main__grid--one-sidebar {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }
}
```

Remove the old `@media (max-width: 1024px)` block entirely.

- [ ] **Step 2: Verify no other max-width queries remain**

Search `layout.css` for `max-width`. The only remaining media queries should be:
- `@media (min-width: 1025px)` (new — sidebar grids)
- `@media (min-width: 1280px)` (existing — button padding, already correct)
- `@media (hover: hover) and (pointer: fine)` (interaction — untouched)
- `@media (hover: none), (pointer: coarse)` (interaction — untouched)

- [ ] **Step 3: Commit**

```bash
git add web/themes/custom/kaindl_theme/css/layout.css
git commit -m "refactor(theme): convert layout.css to mobile-first breakpoints"
```

---

### Task 4: Refactor header.css to mobile-first

**Files:**
- Modify: `web/themes/custom/kaindl_theme/css/header.css`

This file has `@media (min-width: 1025px)` (desktop) and `@media (max-width: 1024px)` (mobile). The strategy: move `max-width: 1024px` content into base styles, keep `min-width: 1025px` as desktop override.

**Important:** Do NOT touch any `transition` or animation properties. Copy them exactly as they appear.

- [ ] **Step 1: Merge mobile styles into base**

The current base `.site-header` sets `min-height: 97px` (desktop value). The `max-width: 1024px` block overrides to `84px`. In mobile-first, the base should use `84px` and desktop overrides to `97px`.

Rewrite the file with the following structure. The full rewritten header.css content:

**Base styles (mobile-first):** Set all shared properties with mobile values as defaults.

Key changes to base (no media query):
- `.site-header` — `min-height: 84px`, `position: sticky`, `top: 0` (were desktop values before)
- `.site-header__main` — `min-height: 84px`
- `.site-header__inner` — `min-height: 84px`, `padding: 0 14px`, `position: relative`
- `.site-header__branding` — `position: absolute`, `left: 50%`, `top: 50%`, `transform: translate(-50%, -50%)`, `margin-right: 0`, `z-index: 4`
- `.site-header__brand-link` — `width: 65px`
- `.site-header__nav` — `flex: 1 1 100%`, `width: 100%`
- `.site-header__nav-container` — `min-height: 84px`, `gap: 0`, `justify-content: stretch`
- `.site-header__icon-list` — `gap: 15px`, `margin-left: 0`, `justify-content: flex-start`, `width: 100%`, `z-index: 3`
- `.lang-select__chevron` — `display: block` (mobile shows chevron)
- Mobile hamburger styles, mobile lang-select overrides, mobile compact overrides — all move to base

**Desktop override `@media (min-width: 1025px)`:** Reset mobile positioning back to desktop layout.

Key desktop overrides:
- `.site-header` — `min-height: 97px`, `position: relative`, `top: auto`
- `.site-header__main` — `min-height: 97px`
- `.site-header__inner` — `min-height: 97px`, `max-width: var(--kaindl-container-max)`, `padding-left/right: var(--kaindl-gutter)`, `position: static`
- `.site-header__branding` — `position: static`, `left: auto`, `top: auto`, `transform: none`, `margin-right: 28px`, `z-index: auto`
- `.site-header__brand-link` — `width: 130px`
- `.site-header__nav` — `flex: 1 1 auto`, `width: auto`
- `.site-header__nav-container` — `min-height: 97px`, `gap: 18px`, `justify-content: space-between`
- `.site-header__icon-list` — `flex: 0 0 auto`, `gap: 23px`, `margin-left: 24px`, `padding: 23px 0 25px`, `transform: translateY(2px)`, `width: auto`, `z-index: auto`, `justify-content: initial`
- `.lang-select__chevron` — `display: none`
- Hide hamburger: `.headerbar__navitem--icon-hamburger { display: none; }`
- Desktop headerbar__main positioning

**Keep untouched:** All `.is-header-transitioning` transition blocks, `.is-header-compact` transition blocks, `@media (prefers-reduced-motion)` block, all lang-select panel transition/animation properties.

- [ ] **Step 2: Remove the `@media (max-width: 1024px)` block entirely**

After merging its contents into the base styles, delete the entire `@media (max-width: 1024px) { ... }` block.

- [ ] **Step 3: Verify the file structure**

The file should now contain exactly these media query blocks:
1. `@media (min-width: 1025px)` — desktop overrides
2. `@media (prefers-reduced-motion: reduce)` — accessibility (untouched)

No `max-width` queries should remain.

- [ ] **Step 4: Visual verification**

Take screenshots at 375px, 1024px, and 1920px. Compare with baseline screenshots from Task 1 for:
- Header height (84px mobile, 97px desktop)
- Logo centering on mobile, left-aligned on desktop
- Hamburger visible on mobile, hidden on desktop
- Language selector chevron visible on mobile, hidden on desktop
- Icon spacing

- [ ] **Step 5: Commit**

```bash
git add web/themes/custom/kaindl_theme/css/header.css
git commit -m "refactor(theme): convert header.css to mobile-first breakpoints"
```

---

### Task 5: Refactor navigation.css to mobile-first

**Files:**
- Modify: `web/themes/custom/kaindl_theme/css/navigation.css`

This file has:
- `@media (min-width: 1025px)` — desktop nav
- `@media (max-width: 1024px)` — mobile sidebar (lines 229-725)
- `@media (min-width: 1025px) and (max-width: 1680px)` — intermediate (lines 727-749)
- `@media (max-width: 1280px)` — nav padding reduction (lines 751-762)
- `@media (prefers-reduced-motion: reduce)` — keep untouched

**Strategy:**
1. Move `max-width: 1024px` content to base
2. Move `max-width: 1280px` content into the `min-width: 1025px` block (as the default desktop size)
3. Convert `(min-width: 1025px) and (max-width: 1680px)` to: set smaller values as default in `1025px`, add full values at `1536px`
4. Keep `prefers-reduced-motion` untouched

- [ ] **Step 1: Restructure base styles**

Move all styles from `@media (max-width: 1024px)` into base (no query). These include:
- `body.is-mobile-nav-open { overflow: hidden; }`
- `.site-header { --site-mobile-sidebar-width: min(420px, 88vw); }`
- Mobile sidebar shell (`.site-nav__mobile-shell` positioning, transform, transitions)
- Mobile head (`.site-nav__mobile-head` display, styling)
- Mobile overlay collapse (grid-template-rows: 0fr pattern)
- All mobile stagger animation delays (nth-child patterns)
- Mobile toggle button display
- Mobile nav link styles
- Hide media panel and overlay header on mobile

**Important:** Keep ALL transition properties exactly as-is. Do not modify any `transition:`, `transform:`, or animation timing values.

- [ ] **Step 2: Restructure desktop overrides**

In the `@media (min-width: 1025px)` block, include:
- Reset mobile sidebar to inline nav: `.site-nav__mobile-shell` gets `margin: auto`, `min-width: 0` and resets all mobile positioning (remove `position: fixed`, `transform`, `visibility`, etc.)
- `.site-nav__mobile-head { display: none !important; }` (keep the `!important` — it exists in current code)
- Nav list styling: `.headerbar__nav-list--main` flex, centered, gap
- Nav link underline animation (the `::after` clip-path pattern)
- Toggle hidden: `.site-nav__toggle { display: none !important; }`

Set the **smaller desktop values** as defaults in this block (what was previously in `1025-1680` range):
- `.site-nav__list { gap: 24px; }` (not 30px)
- `.site-nav__link, .lang-select__trigger { font-size: 13px; }` (not 14px)
- `.site-header__icon-list { padding: 15px 0 23px 0; gap: 15px; }` (not 23px gap / 23px+25px padding)
- Nav link padding: `--site-nav-link-pad-x: 10px; padding-left: 10px; padding-right: 10px;` (smaller, from the old 1280px query)
- Brand link width: `width: 60px;` (from old 1280px query — but this is overridden in header.css's desktop block to 130px, so check cascade)

**Note on brand-link width:** The `max-width: 1280px` rule in navigation.css sets `.site-header__brand-link` to `60px`. But header.css desktop block sets it to `130px`. Since header.css loads first and navigation.css loads after, the navigation.css rule would override. This is a bug — at 1025-1280px the logo was tiny. **Fix:** Do not set brand-link width in navigation.css at all. Let header.css handle it (65px mobile, 130px desktop). Remove the `.site-header__brand-link` and `.site-header__logo--small` width rules from navigation.css entirely.

- [ ] **Step 3: Add wide desktop overrides**

Add a `@media (min-width: 1536px)` block with the full-size desktop values:

```css
@media (min-width: 1536px) {
  .site-nav__list {
    gap: 30px;
  }

  .site-nav__link,
  .lang-select__trigger {
    font-size: 14px;
  }

  .site-header__icon-list {
    gap: 23px;
    padding: 23px 0 25px 0;
  }

  .site-header
    .headerbar__nav-list--main
    > .site-nav__item
    > .site-nav__link {
    --site-nav-link-pad-x: 15px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .site-nav__overlay-heading {
    font-size: 44px;
  }

  .site-nav__overlay-link {
    font-size: 18px;
  }
}
```

- [ ] **Step 4: Delete old media query blocks**

Remove these entirely:
- `@media (max-width: 1024px) { ... }`
- `@media (min-width: 1025px) and (max-width: 1680px) { ... }`
- `@media (max-width: 1280px) { ... }`

- [ ] **Step 5: Set intermediate values in the 1025px block**

In the `@media (min-width: 1025px)` block, also set the intermediate overlay values that were previously in the `1680px` compound query:

```css
  .site-nav__overlay-heading {
    font-size: 32px;
  }

  .site-nav__overlay-link {
    font-size: 16px;
  }
```

- [ ] **Step 6: Verify file structure**

The file should now have exactly:
1. Base styles (no query) — includes mobile sidebar, toggles, mobile overlay behavior
2. `@media (min-width: 1025px)` — desktop nav with smaller default sizing
3. `@media (min-width: 1536px)` — full-size desktop nav
4. `@media (prefers-reduced-motion: reduce)` — untouched

No `max-width` or compound queries.

- [ ] **Step 7: Visual verification**

Take screenshots at 375px, 1024px, 1280px, and 1920px. Compare with baselines for:
- Mobile sidebar (open it via hamburger at 375px and 1024px)
- Desktop nav link spacing at 1280px vs 1920px
- Logo size at each width
- Toggle visibility

- [ ] **Step 8: Commit**

```bash
git add web/themes/custom/kaindl_theme/css/navigation.css
git commit -m "refactor(theme): convert navigation.css to mobile-first breakpoints

Consolidates 5 media queries into 3 ascending min-width blocks.
Fixes brand-link width bug at 1025-1280px range."
```

---

### Task 6: Refactor megamenu.css to mobile-first

**Files:**
- Modify: `web/themes/custom/kaindl_theme/css/megamenu.css`

This file has:
- `@media (min-width: 1025px)` — main desktop megamenu (lines 20-595)
- `@media (min-width: 1025px) and (max-width: 1500px)` — font adjustments (lines 597-615)
- `@media (min-width: 1025px) and (max-width: 1420px)` — 2-col layout (lines 617-629)
- `@media (min-width: 1025px) and (max-width: 1180px)` — hide media panel (lines 631-649)
- `@media (max-width: 1440px)` — padding adjustment (lines 651-656)
- `@media (prefers-reduced-motion: reduce)` — keep untouched

**Strategy:** The megamenu is desktop-only (hidden on mobile via navigation.css). So we restructure the desktop blocks from smallest-desktop-first ascending.

**Important:** Do NOT touch any animation keyframes, `animation:` properties, `transition:` properties, or timing functions. These are working perfectly.

- [ ] **Step 1: Restructure the main `@media (min-width: 1025px)` block**

Keep the block but adjust the default values to represent the **smallest desktop** state (what was previously the 1025-1180 range):

Changes inside the existing `min-width: 1025px` block:
- Overlay padding: `padding: 25px 0 44px 0;` and `padding-right: 16px;` (merge the `max-width: 1440` rule into the default)
- Overlay layout grid: `grid-template-columns: 1fr;` (single column — no media sidebar at smallest desktop)
- Overlay list main grid: `grid-template-columns: repeat(2, minmax(0, 1fr));` (2 columns, not 3)
- Media panel: `display: none;` (hidden at smallest desktop)
- Overlay heading font: `font-size: 26px;` (smaller, from the `1500px` compound query)
- Overlay column divider lines (`::before` / `::after` on `.site-nav__overlay-list--main`): keep as-is

- [ ] **Step 2: Add `@media (min-width: 1280px)` block**

This represents the mid-desktop state (was the 1181-1420 range): media panel appears, 2 columns stay.

```css
@media (min-width: 1280px) {
  .site-header
    .site-nav__overlay[data-site-nav-overlay]
    .site-nav__overlay-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .site-header
    .site-nav__overlay[data-site-nav-overlay]
    .site-nav__media-panel {
    display: grid;
  }

  .site-header .site-nav__overlay[data-site-nav-overlay] {
    padding: 25px 22px 44px 7px;
  }
}
```

- [ ] **Step 3: Add `@media (min-width: 1536px)` block**

This represents the full desktop state (was 1421+ for grid, 1501+ for fonts):

```css
@media (min-width: 1536px) {
  .site-header
    .site-nav__overlay[data-site-nav-overlay]
    .site-nav__overlay-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .site-header
    .site-nav__overlay[data-site-nav-overlay]
    .site-nav__overlay-list--main {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .site-header
    .site-nav__overlay[data-site-nav-overlay]
    .site-nav__overlay-heading {
    font-size: 30px;
  }
}
```

- [ ] **Step 4: Delete old compound/max-width query blocks**

Remove these entirely:
- `@media (min-width: 1025px) and (max-width: 1500px) { ... }`
- `@media (min-width: 1025px) and (max-width: 1420px) { ... }`
- `@media (min-width: 1025px) and (max-width: 1180px) { ... }`
- `@media (max-width: 1440px) { ... }`

- [ ] **Step 5: Verify file structure**

The file should now have exactly:
1. Keyframe definitions (untouched)
2. `@media (min-width: 1025px)` — base desktop megamenu (smallest desktop defaults)
3. `@media (min-width: 1280px)` — media panel appears, wider layout
4. `@media (min-width: 1536px)` — 3-column grid, larger fonts/padding
5. `@media (prefers-reduced-motion: reduce)` — untouched

- [ ] **Step 6: Visual verification**

Open the megamenu (hover "BOARDS") and take screenshots at:
- 1100px (should show 2 columns, no media panel)
- 1280px (should show 2 columns with media panel)
- 1536px (should show 3 columns with media panel)
- 1920px (same as 1536+)

Compare with baselines.

- [ ] **Step 7: Commit**

```bash
git add web/themes/custom/kaindl_theme/css/megamenu.css
git commit -m "refactor(theme): convert megamenu.css to mobile-first breakpoints

Replaces 4 compound/max-width queries with 3 ascending min-width blocks."
```

---

### Task 7: Refactor footer.css to mobile-first

**Files:**
- Modify: `web/themes/custom/kaindl_theme/css/footer.css`

Current queries (all `max-width`):
- `max-width: 1299px` — 3-col grid, smaller padding
- `max-width: 1199px` — single-col bottom bar
- `max-width: 899px` — 2-col grid, left-align
- `max-width: 639px` — 1-col grid, smallest padding

**Strategy:** Reverse to mobile-first. Base = smallest (1-col), build up.

- [ ] **Step 1: Make base styles mobile-first**

Change the base (no-query) styles for footer to use the smallest-screen values:

```css
.site-footer {
  background: #000;
  color: #616161;
  font-size: 15px;
  margin-top: auto;
  padding: 54px 0 34px;
}

.site-footer__top {
  margin-bottom: 38px;
  width: 100%;
}
```

The category grid base becomes single column:
```css
.site-footer__category-grid {
  column-gap: clamp(20px, 2vw, 34px);
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 28px;
}
```

The category base becomes left-aligned:
```css
.site-footer__category {
  min-width: 0;
  text-align: left;
}

.site-footer__category-head {
  margin-bottom: 14px;
}
```

The bottom bar base becomes single column:
```css
.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  column-gap: clamp(26px, 2.4vw, 56px);
  display: grid;
  grid-template-columns: 1fr;
  justify-items: start;
  padding-top: 28px;
  row-gap: 16px;
}

.site-footer__meta-list {
  /* ... existing shared styles ... */
  justify-content: flex-start;
}

.site-footer__socials {
  justify-self: start;
}
```

- [ ] **Step 2: Add ascending breakpoint overrides**

```css
@media (min-width: 640px) {
  .site-footer {
    padding: 70px 0 48px;
  }

  .site-footer__top {
    margin-bottom: 48px;
  }

  .site-footer__category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 34px;
  }

  .site-footer__category-head {
    margin-bottom: 22px;
  }
}

@media (min-width: 1025px) {
  .site-footer__category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-footer__category {
    text-align: center;
  }
}

@media (min-width: 1280px) {
  .site-footer__bottom {
    align-items: center;
    grid-template-columns: auto 1fr auto;
  }

  .site-footer__meta-list {
    justify-content: center;
  }

  .site-footer__socials {
    justify-self: end;
  }
}

@media (min-width: 1536px) {
  .site-footer {
    padding: 90px 0 48px;
  }

  .site-footer__top {
    margin-bottom: 62px;
  }

  .site-footer__category-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
```

- [ ] **Step 3: Remove all old max-width query blocks**

Delete:
- `@media (max-width: 1299px) { ... }`
- `@media (max-width: 1199px) { ... }`
- `@media (max-width: 899px) { ... }`
- `@media (max-width: 639px) { ... }`

- [ ] **Step 4: Visual verification**

Take screenshots of the footer at 375px, 768px, 1280px, and 1920px. Compare with baselines for:
- Column count (1 → 2 → 3 → 6)
- Text alignment (left on mobile, center on desktop)
- Bottom bar layout (stacked → 3-column)
- Padding/spacing

- [ ] **Step 5: Commit**

```bash
git add web/themes/custom/kaindl_theme/css/footer.css
git commit -m "refactor(theme): convert footer.css to mobile-first breakpoints

Replaces 4 max-width queries with 4 ascending min-width blocks."
```

---

### Task 8: Refactor page-header.css to mobile-first

**Files:**
- Modify: `web/themes/custom/kaindl_theme/css/page-header.css`

This file has one `@media (max-width: 640px)` block (lines 159-195).

- [ ] **Step 1: Make base styles mobile-first**

Move the `max-width: 640px` values into the base styles:

Change base `.page-header__media`:
```css
.page-header__media {
  background: #f2f3f2;
  height: clamp(200px, 50vw, 320px);
  overflow: hidden;
  position: relative;
}
```

Change base `.page-header__content`:
```css
.page-header__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0 0;
  align-items: center;
}
```

Change base `.page-header__title`:
```css
.page-header__title {
  font-size: clamp(32px, 9vw, 48px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 0.92;
  margin: 0;
  text-transform: uppercase;
}
```

Change base `.page-header__controls`:
```css
.page-header__controls {
  /* ... keep existing shared styles ... */
  left: 0;
  right: 0;
}
```

Change base `.page-header__meta`:
```css
.page-header__meta {
  align-items: center;
  border-right: 0;
  display: inline-flex;
  flex: 1 1 auto;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  min-width: 0;
  padding: 0 14px;
  text-transform: uppercase;
}
```

Change base `.page-header__nav-wrap`:
```css
.page-header__nav-wrap {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  padding: 0 14px;
}
```

Change base `.page-header__nav`:
```css
.page-header__nav {
  /* ... keep shared styles ... */
  height: 30px;
  width: 30px;
}
```

- [ ] **Step 2: Add desktop overrides**

```css
@media (min-width: 640px) {
  .page-header__media {
    height: clamp(280px, 30vw, 600px);
  }

  .page-header__content {
    gap: 16px;
    padding: clamp(28px, 3vw, 48px) 0 0;
  }

  .page-header__title {
    font-size: clamp(42px, 6vw, 75px);
  }

  .page-header__controls {
    left: auto;
  }

  .page-header__meta {
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    flex: 0 0 auto;
    font-size: clamp(16px, 1.4vw, 22px);
    max-width: min(30ch, calc(100vw - 160px));
    min-width: auto;
    padding: 0 20px;
  }

  .page-header__nav-wrap {
    gap: 13px;
    padding: 0 20px;
  }

  .page-header__nav {
    height: 34px;
    width: 34px;
  }
}
```

- [ ] **Step 3: Remove old max-width block**

Delete: `@media (max-width: 640px) { ... }`

- [ ] **Step 4: Commit**

```bash
git add web/themes/custom/kaindl_theme/css/page-header.css
git commit -m "refactor(theme): convert page-header.css to mobile-first breakpoints"
```

---

### Task 9: Refactor home.css to mobile-first

**Files:**
- Modify: `web/themes/custom/kaindl_theme/css/home.css`

This is the heaviest file with 24 media query blocks. The content queries (`hover:hover`, `prefers-reduced-motion`) stay untouched. The layout breakpoints to convert:

- `max-width: 575px` → base styles
- `max-width: 860px` → base styles, override at `640px`
- `max-width: 1024px` → base or `640px`, override at `1025px`
- `max-width: 1180px` → `1025px` block, override at `1280px`
- `max-width: 1300px` → `1025px` block, override at `1280px`
- `max-width: 1400px` → `1025px` or `1280px`, override at `1536px`
- `max-width: 1536px` → `1280px` block, override at `1536px`

**Important:** This file uses ID-based selectors (`#c6621`, `#c2323`, `#c2568`) for content-element-specific styles. Keep these selectors exactly as-is.

- [ ] **Step 1: Refactor hero section (lines ~1-490)**

The hero section has breakpoints at `1400`, `1536`, `1300`, `1024`, `860`, and `575`.

Make the base hero styles mobile-first by absorbing `max-width: 575px` and `max-width: 860px` values into base, then build up:

Base (mobile):
- `.home-hero` — single column, `min-height: auto`
- `.home-hero__inner` — `flex-direction: column`, no grid
- `.home-hero__content` — full width, mobile padding
- `.home-hero__title` — `font-size: var(--kaindl-type-hero-mobile)`, mobile line-height
- `.home-hero__floating-panel` — repositioned for mobile
- `.home-hero__controls` — full-width bottom bar
- `.home-hero__scroll-indicator` — hidden on smallest mobile

`@media (min-width: 640px)`:
- Restore scroll indicator
- Larger hero controls/meta
- Larger floating panel

`@media (min-width: 1025px)`:
- `.home-hero` — side-by-side layout, `min-height: 800px`
- `.home-hero__inner` — grid layout
- `.home-hero__content` — positioned left panel
- `.home-hero__title` — desktop font size
- `.home-hero__stage` — visible with desktop positioning
- `.home-hero__floating-panel` — desktop positioning
- `.home-hero__nav-wrap` — standard positioning (move `1400px` hide-nav into 1025 default, show at 1536)

`@media (min-width: 1280px)`:
- `.home-hero__meta` — visible (was hidden at `max-width: 1300px`)

`@media (min-width: 1536px)`:
- `.home-hero__title` — full desktop size (from `1536px` override)
- `.home-hero__nav-wrap` — show if needed

Keep `prefers-reduced-motion: no-preference` and `prefers-reduced-motion: reduce` blocks untouched.

- [ ] **Step 2: Refactor text-image-content section (lines ~490-555)**

Current: `max-width: 1024px`, `max-width: 860px`, `max-width: 575px`

Base (mobile): single column layout, mobile spacing from `575px` values
`@media (min-width: 640px)`: intermediate adjustments from `860px` reverse
`@media (min-width: 1025px)`: two-column layout, desktop spacing

- [ ] **Step 3: Refactor iframe section (lines ~556-590)**

Current: `max-width: 1024px`

Base: mobile aspect ratio / layout
`@media (min-width: 1025px)`: desktop layout

- [ ] **Step 4: Refactor collection-teaser section (lines ~600-775)**

Current: `max-width: 1180px`, `max-width: 860px`, `max-width: 575px`

Base (mobile): single column, mobile sizing from `575px`
`@media (min-width: 640px)`: adjustments from `860px` reverse
`@media (min-width: 1280px)`: full desktop layout (from `1180px` reverse)

- [ ] **Step 5: Refactor page-teaser #c6621 section (lines ~776-980)**

Current: `max-width: 1180px`, `max-width: 860px`

Base (mobile): mobile card layout from `860px` values
`@media (min-width: 640px)`: intermediate from `860px` reverse
`@media (min-width: 1280px)`: full desktop from `1180px` reverse

- [ ] **Step 6: Refactor collection-teasers #c2323 section (lines ~980-1470)**

Current: `max-width: 1180px`, `max-width: 860px`

Base (mobile): mobile layout from `860px`
`@media (min-width: 640px)`: intermediate
`@media (min-width: 1280px)`: desktop grid from `1180px` reverse

- [ ] **Step 7: Refactor teaser-slider #c2568 section (lines ~1553-1700)**

Current: `max-width: 1180px`, `max-width: 860px`

Base (mobile): mobile slider from `860px`
`@media (min-width: 640px)`: intermediate
`@media (min-width: 1280px)`: desktop slider from `1180px` reverse

- [ ] **Step 8: Keep interaction and motion queries untouched**

These blocks remain exactly as-is:
- `@media (prefers-reduced-motion: no-preference)` — hero animations
- `@media (prefers-reduced-motion: reduce)` — reduced motion fallbacks
- `@media (hover: hover) and (pointer: fine)` — hover interactions
- `@media (hover: none), (pointer: coarse)` — touch interactions

- [ ] **Step 9: Verify file structure**

The file should now have only these layout query types:
- `@media (min-width: 640px)`
- `@media (min-width: 1025px)`
- `@media (min-width: 1280px)`
- `@media (min-width: 1536px)`
- Plus untouched interaction/motion queries

No `max-width` layout queries should remain.

- [ ] **Step 10: Visual verification**

Take full-page screenshots at 375px, 768px, 1280px, 1920px. Compare every section with baselines:
- Hero layout and sizing
- Text-image sections
- Collection teasers grid
- Page teaser cards
- Footer (already done, just verify no conflicts)

- [ ] **Step 11: Commit**

```bash
git add web/themes/custom/kaindl_theme/css/home.css
git commit -m "refactor(theme): convert home.css to mobile-first breakpoints

Consolidates 16 max-width layout queries into 4 ascending min-width blocks.
Interaction and motion queries remain untouched."
```

---

### Task 10: Final cross-file verification and cleanup

**Files:**
- All CSS files in `web/themes/custom/kaindl_theme/css/`

- [ ] **Step 1: Grep for remaining max-width layout queries**

Search all CSS files for `max-width` to confirm none remain (except in interaction queries like `prefers-reduced-motion`):

```bash
grep -rn "max-width" web/themes/custom/kaindl_theme/css/ | grep -v "prefers-" | grep -v "max-width:" | grep -v ".css:" || echo "Clean!"
```

Also verify `@media` usage:
```bash
grep -n "@media" web/themes/custom/kaindl_theme/css/*.css
```

Expected output: only `min-width: 640px`, `min-width: 1025px`, `min-width: 1280px`, `min-width: 1536px`, plus `prefers-reduced-motion`, `hover:hover`, `hover:none`, `pointer:fine`, `pointer:coarse`.

- [ ] **Step 2: Full-page visual regression at all breakpoints**

Navigate to `https://kaindl.dev.creatizmo.com/en` and take full-page screenshots at:
- 375px
- 768px
- 1024px (edge case — should still be mobile)
- 1025px (edge case — should be desktop)
- 1280px
- 1920px

Compare every screenshot with Task 1 baselines. Flag any visual differences.

- [ ] **Step 3: Test megamenu at desktop widths**

Open megamenu (hover "BOARDS" and "SERVICE & KNOWLEDGE") at 1100px, 1280px, 1536px, 1920px. Verify:
- Column count transitions correctly
- Media panel appears/disappears at correct widths
- Animations still work

- [ ] **Step 4: Test mobile sidebar**

At 375px and 768px:
- Open hamburger menu
- Expand a nav item
- Verify slide-in animation
- Verify stagger animation on submenu items

- [ ] **Step 5: Final commit**

```bash
git add -A
git commit -m "refactor(theme): complete CSS responsive modernization

Summary:
- Consolidated 12+ breakpoints to 4 (640, 1025, 1280, 1536px)
- Converted all files to mobile-first ascending min-width queries
- Eliminated all max-width and compound media queries
- Fixed brand-link width bug at 1025-1280px range
- Added breakpoint documentation to variables.css
- All animations and transitions preserved"
```
