/* ------------------------------------ *\
  #4. BASE ELEMENTS
\* ------------------------------------ */

html {
    font-size: 16px;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background-color: var(--color-bg-main);
    scroll-behavior: smooth;
    /* Mobile-specific optimizations */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Mobile font size adjustments */
@media screen and (max-width: 768px) {
    html {
        font-size: 15px; /* Slightly smaller base size for mobile */
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 14px; /* Even smaller for very small screens */
    }
}

body {
    font-family: var(--font-family-sans);
    font-size: var(--text-m);
    line-height: var(--leading-normal);
    color: var(--color-text-main);
    counter-reset: sidenote-counter;
    /* Mobile optimizations */
    overflow-x: hidden; /* Prevent horizontal scroll */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Mobile body adjustments */
@media screen and (max-width: 768px) {
    body {
        line-height: var(--leading-relaxed); /* Better readability on mobile */
    }
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

[contenteditable="true"]:focus {
    outline: none;
}

[contenteditable="true"]:focus br {
    display: none;
}

/* Layout Base */
header {
    display: flex;
    flex-direction: column;
}

main {
    padding-top: 0;
    min-height: 100vh;
}

.section {
    padding-top: var(--padding-broad);
}

body main > .section {
    padding-top: 0px;
}

/* Box Component */
.box {
    background-color: transparent;
    border-radius: 6px;
    display: block;
    padding: 1.75rem;
    border: 1px solid var(--color-border-light);
}

a.box:hover,
a.box:focus {
    box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0 0 1px #485fc7;
}

a.box:active {
    box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2), 0 0 0 1px #485fc7;
}

/* Responsive padding */
.p-responsive {
    padding: 2rem !important;
}

@media screen and (min-width: 1024px) and (max-width: 1215px) {
    .p-responsive {
        padding: 3rem !important;
    }
}

@media screen and (min-width: 1216px) {
    .p-responsive {
        padding: 3rem !important;
    }
}

@media screen and (min-width: 1408px) {
    .p-responsive {
        padding: 3rem;
    }
} 