/* =========================================================
   MIDAD — MOBILE.CSS
   إصلاح وتجهيز الموقع للجوال
========================================================= */

/* =========================================================
   01 — GLOBAL SAFETY
========================================================= */

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
video,
iframe,
svg,
canvas {
    max-width: 100%;
}

img,
video {
    height: auto;
}

button,
a,
input,
textarea,
select {
    max-width: 100%;
}

section,
header,
footer,
main,
nav,
div {
    max-width: 100%;
}


/* =========================================================
   02 — CONTAINER
========================================================= */

.container {
    width: min(90%, 1200px);
    margin-inline: auto;
}


/* =========================================================
   03 — NAVBAR
========================================================= */

@media (max-width: 768px) {

    .navbar {
        width: 100%;
        padding: 0 18px;
    }

    .navbar-inner {
        width: 100%;
        min-height: 70px;
        gap: 15px;
    }

    .logo {
        flex-shrink: 0;
    }

    .nav-links {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav-links a {
        font-size: 12px;
        white-space: nowrap;
    }

    .navbar a {
        max-width: 100%;
    }
}


/* =========================================================
   04 — HERO
========================================================= */

@media (max-width: 768px) {

    .hero {
        width: 100%;
        min-height: auto;
        padding: 120px 0 70px;
    }

    .hero-content {
        width: 100%;
    }

    .hero h1 {
        max-width: 100%;
        font-size: clamp(42px, 13vw, 72px);
        line-height: 1.05;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .hero h2,
    .hero h3 {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .hero p {
        max-width: 100%;
        font-size: 14px;
        line-height: 1.9;
    }

    .hero-actions,
    .hero-buttons {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }
}


/* =========================================================
   05 — SECTIONS
========================================================= */

@media (max-width: 768px) {

    section {
        width: 100%;
        overflow: hidden;
    }

    .section,
    .about-section,
    .projects-section,
    .contact-section {
        width: 100%;
        padding-top: 70px;
        padding-bottom: 70px;
    }

    .section-head,
    .section-header {
        width: 100%;
        display: block;
    }

    .section-title {
        max-width: 100%;
        font-size: clamp(32px, 9vw, 50px);
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .section-label {
        font-size: 10px;
    }
}


/* =========================================================
   06 — ALL GRIDS
========================================================= */

@media (max-width: 768px) {

    .grid,
    .about-grid,
    .projects-grid,
    .cards-grid,
    .values,
    .values-grid,
    .certificates-grid,
    .contact-grid,
    .services-grid,
    .portfolio-grid,
    .features-grid {
        grid-template-columns: 1fr !important;
        width: 100%;
    }

    .grid > *,
    .about-grid > *,
    .projects-grid > *,
    .cards-grid > *,
    .values > *,
    .values-grid > *,
    .certificates-grid > *,
    .contact-grid > *,
    .services-grid > *,
    .portfolio-grid > *,
    .features-grid > * {
        min-width: 0;
        max-width: 100%;
    }
}


/* =========================================================
   07 — FLEX ROWS
========================================================= */

@media (max-width: 768px) {

    .about-head,
    .certificates-head,
    .contact-head,
    .project-head,
    .section-head {
        gap: 20px;
    }

    .about-head,
    .certificates-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .flex-row,
    .actions,
    .buttons {
        flex-wrap: wrap;
    }
}


/* =========================================================
   08 — CARDS
========================================================= */

@media (max-width: 768px) {

    .card,
    .project-card,
    .value-card,
    .certificate-card,
    .service-card,
    .contact-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .project-card,
    .certificate-card,
    .value-card {
        overflow: hidden;
    }

    .project-card h3,
    .project-card h4,
    .certificate-card h4,
    .value-card h3,
    .value-card h4 {
        overflow-wrap: anywhere;
    }

    .certificate-card {
        padding: 18px;
    }

    .certificate-content {
        min-width: 0;
    }
}


/* =========================================================
   09 — BUTTONS
========================================================= */

@media (max-width: 768px) {

    .cta-button,
    .project-open,
    .button,
    .btn,
    .hero-button,
    .hero-actions a {
        max-width: 100%;
    }

    .hero-actions a,
    .hero-buttons a {
        min-height: 48px;
    }
}

@media (max-width: 480px) {

    .cta-button,
    .project-open,
    .button,
    .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}


/* =========================================================
   10 — IMAGES
========================================================= */

@media (max-width: 768px) {

    .about-photo,
    .about-image,
    .image-wrap,
    .project-image {
        width: 100%;
        max-width: 100%;
    }

    .about-photo img,
    .about-image img,
    .image-wrap img,
    .project-image img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        object-fit: cover;
    }
}


/* =========================================================
   11 — VIDEO
========================================================= */

@media (max-width: 768px) {

    video {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .video-container,
    .video-wrapper,
    .media,
    .media-wrapper {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .video-container video,
    .video-wrapper video,
    .media video,
    .media-wrapper video {
        width: 100%;
    }
}


/* =========================================================
   12 — IFRAME
========================================================= */

@media (max-width: 768px) {

    iframe {
        width: 100%;
        max-width: 100%;
    }
}


/* =========================================================
   13 — TEXT
========================================================= */

@media (max-width: 768px) {

    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    span,
    a {
        overflow-wrap: anywhere;
    }

    p {
        line-height: 1.9;
    }
}


/* =========================================================
   14 — MARQUEE
========================================================= */

@media (max-width: 768px) {

    .marquee,
    .about-marquee {
        width: 100%;
        overflow: hidden;
    }

    .marquee-track {
        width: max-content;
        max-width: none;
    }
}


/* =========================================================
   15 — TIMELINE
========================================================= */

@media (max-width: 768px) {

    .timeline,
    .journey,
    .about-journey {
        width: 100%;
    }

    .timeline-item,
    .journey-item {
        width: 100%;
        max-width: 100%;
    }
}


/* =========================================================
   16 — FOOTER
========================================================= */

@media (max-width: 768px) {

    footer {
        width: 100%;
        overflow: hidden;
    }

    .footer-inner,
    .footer-grid {
        width: 100%;
        grid-template-columns: 1fr !important;
    }

    .footer-links {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

    footer p,
    footer a {
        overflow-wrap: anywhere;
    }
}


/* =========================================================
   17 — CONTACT
========================================================= */

@media (max-width: 768px) {

    .contact-card {
        padding: 22px;
    }

    .contact-grid {
        gap: 20px;
    }

    .contact-links {
        width: 100%;
    }

    .contact-links a {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}


/* =========================================================
   18 — ORBIT / DECORATIVE ELEMENTS
========================================================= */

@media (max-width: 768px) {

    .orbit,
    .orbit-system,
    .orbital-system {
        transform: scale(.72);
        transform-origin: center;
    }

    .decorative,
    .floating-element {
        max-width: 100%;
    }
}


/* =========================================================
   19 — CODE TERMINAL
========================================================= */

@media (max-width: 768px) {

    .terminal,
    .code-terminal,
    .terminal-window {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .terminal pre,
    .terminal code,
    .code-terminal pre,
    .code-terminal code {
        max-width: 100%;
        overflow-x: auto;
        white-space: pre;
        font-size: 11px;
    }
}


/* =========================================================
   20 — PROGRAMMING / CONTENT / VOICEOVER
========================================================= */

@media (max-width: 768px) {

    .project-meta,
    .project-tags,
    .tags,
    .skills,
    .tools {
        display: flex;
        flex-wrap: wrap;
        max-width: 100%;
        gap: 7px;
    }

    .project-tag,
    .tag,
    .skill,
    .tool {
        max-width: 100%;
    }
}


/* =========================================================
   21 — ATHAR TICKET
========================================================= */

@media (max-width: 768px) {

    .ticket,
    .ticket-container,
    .ticket-card {
        width: 100%;
        max-width: 100%;
    }

    .ticket-content {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}


/* =========================================================
   22 — SMALL PHONES
========================================================= */

@media (max-width: 480px) {

    .container {
        width: 90%;
    }

    .hero {
        padding-top: 105px;
        padding-bottom: 55px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero p {
        font-size: 13px;
    }

    .section-title,
    .certificates-title {
        font-size: 32px;
    }

    .certificate-icon {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
        font-size: 18px;
    }

    .certificate-card {
        gap: 12px;
    }

    .certificate-arrow {
        display: none;
    }
}


/* =========================================================
   23 — VERY SMALL PHONES
========================================================= */

@media (max-width: 360px) {

    .container {
        width: 92%;
    }

    .hero h1 {
        font-size: 36px;
    }

    .nav-links {
        gap: 6px;
    }

    .nav-links a {
        font-size: 9px;
    }
}


/* =========================================================
   24 — PREVENT HORIZONTAL OVERFLOW
========================================================= */

body {
    overflow-x: clip;
}

[style*="width: 100vw"],
[style*="width:100vw"] {
    max-width: 100%;
}


/* =========================================================
   25 — TOUCH FRIENDLY
========================================================= */

@media (max-width: 768px) {

    a,
    button {
        -webkit-tap-highlight-color: transparent;
    }

    button,
    .btn,
    .cta-button,
    .project-open {
        min-height: 44px;
    }
}


/* =========================================================
   26 — DISABLE DESKTOP HOVER TRANSFORM ON TOUCH
========================================================= */

@media (hover: none) and (pointer: coarse) {

    .card:hover,
    .project-card:hover,
    .certificate-card:hover,
    .value-card:hover {
        transform: none;
    }
}