/*
Theme Name: Halsnæs Lilleskole
Theme URI: https://halsnaesskolen.dk
Author: Halsnæs Lilleskole
Author URI: https://halsnaesskolen.dk
Description: Et moderne, minimalt WordPress-tema bygget til Elementor Pro. Designet specifikt til Halsnæs Lilleskole med fuld Theme Builder-understøttelse.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: halsnaes-lilleskole
Tags: elementor, education, school, custom-logo, custom-menu, theme-options, translation-ready
*/

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    /* Brand Colors */
    --hl-orange: #f38337;
    --hl-orange-dark: #ce6835;
    --hl-blue: #3d3db4;
    --hl-coral: #f37262;
    --hl-beige: #f8f2e6;
    --hl-dark: #000a15;

    /* Functional Colors */
    --hl-text: #1a1a1a;
    --hl-text-light: #555555;
    --hl-bg: #ffffff;
    --hl-bg-alt: var(--hl-beige);
    --hl-border: #e0d8cc;
    --hl-link: var(--hl-blue);
    --hl-link-hover: var(--hl-orange);

    /* Typography */
    --hl-font-body: 'Nunito', 'Trebuchet MS', sans-serif;
    --hl-font-heading: 'Nunito', 'Trebuchet MS', sans-serif;
    --hl-font-nav: 'Poppins', 'Nunito', sans-serif;
    --hl-font-size-base: 1rem;
    --hl-line-height: 1.7;

    /* Spacing */
    --hl-spacing-xs: 0.5rem;
    --hl-spacing-sm: 1rem;
    --hl-spacing-md: 2rem;
    --hl-spacing-lg: 4rem;
    --hl-spacing-xl: 6rem;

    /* Layout */
    --hl-container-width: 1200px;
    --hl-sidebar-width: 300px;
    --hl-border-radius: 8px;

    /* Transitions */
    --hl-transition: 0.25s ease;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--hl-font-body);
    font-size: var(--hl-font-size-base);
    line-height: var(--hl-line-height);
    color: var(--hl-text);
    background-color: var(--hl-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--hl-font-heading);
    font-weight: 800;
    line-height: 1.25;
    margin-top: 0;
    margin-bottom: 0.75em;
    color: var(--hl-dark);
}

h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.625rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.375rem, 2.5vw, 1.875rem); }
h4 { font-size: clamp(1.125rem, 2vw, 1.5rem); }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-top: 0;
    margin-bottom: 1.25em;
}

a {
    color: var(--hl-link);
    text-decoration: none;
    transition: color var(--hl-transition);
}

a:hover,
a:focus {
    color: var(--hl-link-hover);
}

a:focus-visible {
    outline: 2px solid var(--hl-orange);
    outline-offset: 2px;
    border-radius: 2px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
}

.hl-container {
    width: 100%;
    max-width: var(--hl-container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--hl-spacing-md);
    padding-right: var(--hl-spacing-md);
}

/* ==========================================================================
   Header (Fallback – overridden by Elementor Theme Builder)
   ========================================================================== */

.site-header {
    background-color: var(--hl-bg);
    border-bottom: 1px solid var(--hl-border);
    padding: var(--hl-spacing-sm) 0;
}

.site-header .hl-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--hl-spacing-sm);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: var(--hl-spacing-sm);
}

.site-branding .custom-logo {
    max-height: 60px;
    width: auto;
}

.site-title {
    font-family: var(--hl-font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--hl-dark);
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

.site-description {
    margin: 0;
    font-size: 0.875rem;
    color: var(--hl-text-light);
}

/* Navigation (Fallback) */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--hl-spacing-xs);
}

.main-navigation a {
    font-family: var(--hl-font-nav);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--hl-dark);
    padding: 0.5em 1em;
    border-radius: var(--hl-border-radius);
    transition: background-color var(--hl-transition), color var(--hl-transition);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    background-color: var(--hl-orange);
    color: #ffffff;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 2px solid var(--hl-dark);
    border-radius: var(--hl-border-radius);
    padding: 0.5em 1em;
    font-family: var(--hl-font-nav);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--hl-dark);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation ul {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: var(--hl-spacing-sm);
    }

    .main-navigation.toggled ul {
        display: flex;
    }
}

/* ==========================================================================
   Footer (Fallback – overridden by Elementor Theme Builder)
   ========================================================================== */

.site-footer {
    background-color: var(--hl-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--hl-spacing-lg) 0 var(--hl-spacing-md);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
}

.site-footer a:hover {
    color: var(--hl-orange);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--hl-spacing-md);
    margin-bottom: var(--hl-spacing-md);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: var(--hl-spacing-sm);
    font-size: 0.875rem;
    text-align: center;
}

/* ==========================================================================
   Content
   ========================================================================== */

.entry-header {
    margin-bottom: var(--hl-spacing-md);
}

.entry-title {
    margin-bottom: 0.25em;
}

.entry-title a {
    color: var(--hl-dark);
}

.entry-title a:hover {
    color: var(--hl-orange);
}

.entry-meta {
    font-size: 0.875rem;
    color: var(--hl-text-light);
}

.entry-meta a {
    color: var(--hl-text-light);
}

.entry-content {
    margin-bottom: var(--hl-spacing-md);
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

.entry-footer {
    font-size: 0.875rem;
    color: var(--hl-text-light);
    padding-top: var(--hl-spacing-sm);
    border-top: 1px solid var(--hl-border);
}

/* Post cards on archive pages */
.post-card {
    background: var(--hl-bg);
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-border-radius);
    overflow: hidden;
    transition: box-shadow var(--hl-transition), transform var(--hl-transition);
}

.post-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.post-card .post-thumbnail img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.post-card .post-card-content {
    padding: var(--hl-spacing-md);
}

/* Post navigation */
.post-navigation {
    margin-top: var(--hl-spacing-lg);
    padding-top: var(--hl-spacing-md);
    border-top: 1px solid var(--hl-border);
    display: flex;
    justify-content: space-between;
    gap: var(--hl-spacing-md);
}

/* Pagination */
.pagination {
    margin-top: var(--hl-spacing-lg);
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: var(--hl-border-radius);
    font-weight: 600;
    color: var(--hl-dark);
    background: var(--hl-bg-alt);
    transition: background-color var(--hl-transition), color var(--hl-transition);
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background-color: var(--hl-orange);
    color: #ffffff;
}

/* ==========================================================================
   Sidebar & Widgets
   ========================================================================== */

.widget-area {
    font-size: 0.9375rem;
}

.widget {
    margin-bottom: var(--hl-spacing-md);
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--hl-spacing-sm);
    padding-bottom: var(--hl-spacing-xs);
    border-bottom: 2px solid var(--hl-orange);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    padding: 0.375em 0;
    border-bottom: 1px solid var(--hl-border);
}

.widget li:last-child {
    border-bottom: none;
}

/* ==========================================================================
   Forms
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
textarea,
select {
    font-family: var(--hl-font-body);
    font-size: 1rem;
    padding: 0.75em 1em;
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-border-radius);
    background: var(--hl-bg);
    color: var(--hl-text);
    width: 100%;
    transition: border-color var(--hl-transition), box-shadow var(--hl-transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--hl-orange);
    box-shadow: 0 0 0 3px rgba(243, 131, 55, 0.15);
}

button,
input[type="submit"],
.wp-block-button__link {
    font-family: var(--hl-font-nav);
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.75em 2em;
    border: none;
    border-radius: var(--hl-border-radius);
    background-color: var(--hl-orange);
    color: #ffffff;
    cursor: pointer;
    transition: background-color var(--hl-transition), transform var(--hl-transition);
}

button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
    background-color: var(--hl-orange-dark);
    transform: translateY(-1px);
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: var(--hl-spacing-xl) 0;
}

.error-404 .error-code {
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 800;
    color: var(--hl-orange);
    line-height: 1;
    margin-bottom: var(--hl-spacing-sm);
}

.error-404 .search-form {
    max-width: 500px;
    margin: var(--hl-spacing-md) auto 0;
    display: flex;
    gap: var(--hl-spacing-xs);
}

.error-404 .search-form input[type="search"] {
    flex: 1;
}

/* ==========================================================================
   Search Results
   ========================================================================== */

.search-results .page-header {
    margin-bottom: var(--hl-spacing-md);
    padding-bottom: var(--hl-spacing-sm);
    border-bottom: 2px solid var(--hl-orange);
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--hl-bg);
    border-radius: var(--hl-border-radius);
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: var(--hl-dark);
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    background: var(--hl-orange);
    color: #ffffff;
    padding: 0.75em 1.5em;
    border-radius: 0 0 var(--hl-border-radius) var(--hl-border-radius);
    font-weight: 700;
}

.skip-link:focus {
    top: 0;
    color: #ffffff;
}

/* ==========================================================================
   WordPress Core Alignment
   ========================================================================== */

.alignleft {
    float: left;
    margin-right: var(--hl-spacing-md);
    margin-bottom: var(--hl-spacing-sm);
}

.alignright {
    float: right;
    margin-left: var(--hl-spacing-md);
    margin-bottom: var(--hl-spacing-sm);
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: var(--hl-text-light);
    margin-top: 0.5em;
}

/* ==========================================================================
   Elementor Overrides
   ========================================================================== */

/* Ensure Elementor full-width works properly */
.elementor-page .site-content {
    padding: 0;
}

/* Elementor compatibility: remove default margins when Elementor is active */
body.elementor-default .entry-content,
body.elementor-page .entry-content {
    margin: 0;
    padding: 0;
    max-width: none;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .site-header,
    .site-footer,
    .main-navigation,
    .sidebar,
    .pagination,
    .post-navigation {
        display: none;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

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