/* assets/css/styles.css */

/* Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Orbitron', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Light mode (default) */
body {
    background-color: #ffffff;
    color: #333333;
}

/* Dark mode */
[data-theme="dark"] {
    background-color: #0d0d0d;
    color: #e0e0e0;
}

/* Links */
a {
    color: #FF4500;
    text-decoration: none;
}

a:hover {
    color: #FF0000;
}

/* Header */
header {
    background: #111;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

/* Logo */
.logo a {
    font-size: 2rem;
    color: #FF4500;
    font-weight: bold;
    letter-spacing: 1px;
    text-decoration: none;
}

/* HAMBURGER MENU – visible on ALL sizes */
.hamburger {
    display: flex;                /* key: always visible */
    flex-direction: column;
    justify-content: space-between;
    width: 36px;
    height: 28px;
    cursor: pointer;
    padding: 4px 0;
    transition: transform 0.3s ease;
    order: -1;                    /* left of logo */
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.hamburger span {
    width: 100%;
    height: 4px;
    background: #FF4500;
    border-radius: 3px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 6px rgba(255, 69, 0, 0.5);
}

.hamburger:hover {
    transform: scale(1.15);
}

.hamburger:hover span {
    background: #FF0000;
    box-shadow: 0 0 14px rgba(255, 0, 0, 0.85);
}

/* Hide checkbox BUT keep it functional */
.menu-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Navigation – dropdown controlled by checkbox */
.nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #111;
    padding: 2rem 1rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.7);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
}

.nav-menu a {
    color: #e0e0e0;
    font-size: 1.2rem;
    white-space: nowrap;
}

.nav-menu a:hover {
    color: #FF4500;
}

/* Show menu when open */
#menu-toggle:checked ~ .nav-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* X animation */
#menu-toggle:checked + .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}
#menu-toggle:checked + .hamburger span:nth-child(2) {
    opacity: 0;
}
#menu-toggle:checked + .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Theme toggle – right side */
.theme-toggle {
    margin-left: auto;
    flex: 0 1 auto;
    min-width: 0;
}

.theme-toggle button {
    background: #FF4500;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 0 10px #FF4500;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 0.9rem;
}

.theme-toggle button:hover {
    background: #FF0000;
    box-shadow: 0 0 15px #FF0000;
}

/* Main content */
main.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Headings */
h1, h2 {
    color: #FF4500;
    margin-bottom: 1.2rem;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2 {
    color: #FF7518;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    header .container {
        flex-wrap: nowrap;
        gap: 0.25rem;
        align-items: center;
    }

    .logo a {
        font-size: 1.4rem;
        white-space: nowrap;
    }

    .theme-toggle button {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    p  { font-size: 1rem; line-height: 1.6; }

    iframe {
        width: 100% !important;
        max-width: 100%;
    }

    main.container {
        padding: 0 16px;
    }

    footer p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    img[height="150"] {
        height: 130px !important;
        width: auto;
    }
}

/* ────────────────────────────────────────
   FIX DEV ICONS SIZE ON CODING PAGE
───────────────────────────────────────── */
.dev-icons img,
div[style*="display: flex"][style*="gap: 12px"] img {
    height: 30px !important;
    width: auto !important;
    max-height: 30px !important;
}

/* Slightly smaller on very small screens */
@media (max-width: 480px) {
    .dev-icons img,
    div[style*="display: flex"][style*="gap: 12px"] img {
        height: 26px !important;
    }
}

  .twitch-container {
    position: relative;
    width: 100%;           /* Full width of its parent element */
    padding-bottom: 56.25%; /* 16:9 aspect ratio (9/16 = 0.5625) */
    height: 0;
    overflow: hidden;
  }

  #twitch-embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

/* Responsive Daily.dev Cards */
.devcard-container {
  text-align: center;
  margin: 2rem 0;
}

.devcard {
  display: block;          /* Makes <a> behave like a block for centering */
  margin: 0 auto;          /* Center horizontally */
  max-width: 100%;         /* Never overflow container */
}

.devcard-wide {
  display: block;          /* Visible by default */
}

.devcard-mobile {
  display: none;           /* Hidden by default (mobile version) */
}

/* Mobile-first: show narrow card on small screens */
@media (max-width: 767px) {  /* Typical mobile/tablet breakpoint; adjust if needed */
  .devcard-wide {
    display: none;
  }
  .devcard-mobile {
    display: block;
  }
}

/* Optional: on very wide screens, cap the wide card width so it doesn't stretch too much */
@media (min-width: 1200px) {
  .devcard-wide img {
    max-width: 652px;      /* Matches your original wide width */
  }
}
