/* =========================================================
   HAMSA THEME
   MAIN / GLOBAL STYLESHEET
   =========================================================
   Design System:
   - Black
   - Gold
   - Gray
   - White

   Main CSS owns:
   - Global reset
   - Design variables
   - Typography
   - Containers
   - Content foundation
   - Links
   - Buttons
   - Forms
   - WordPress content basics

   Component CSS owns:
   - Header
   - Navigation
   - Mobile
   - Footer
   - Individual sections
   ========================================================= */


/* =========================================================
   DESIGN TOKENS
   ========================================================= */

:root {

    /* Core colours */
    --hamsa-black: #111111;
    --hamsa-black-soft: #222222;

    --hamsa-gold: #c6a15b;
    --hamsa-gold-dark: #9d7a2f;

    --hamsa-white: #ffffff;

    --hamsa-gray-50: #f7f7f7;
    --hamsa-gray-100: #eeeeee;
    --hamsa-gray-200: #dddddd;
    --hamsa-gray-300: #cccccc;
    --hamsa-gray-500: #666666;
    --hamsa-gray-700: #444444;

    /* Text */
    --hamsa-text: #222222;
    --hamsa-muted: #666666;

    /* Borders */
    --hamsa-border: #dddddd;

    /* Layout */
    --hamsa-container: 1280px;
    --hamsa-content: 860px;

    /* Spacing */
    --hamsa-section-space: 24px;
    --hamsa-content-space: 24px;

    /* Typography */
    --hamsa-body-size: 17px;
    --hamsa-body-line: 1.7;

    --hamsa-small-size: 15px;

    --hamsa-h1: 30px;
    --hamsa-h2: 26px;
    --hamsa-h3: 22px;

}


/* =========================================================
   GLOBAL RESET
   ========================================================= */

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

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

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;

    background: var(--hamsa-white);
    color: var(--hamsa-text);

    font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: var(--hamsa-body-size);
    line-height: var(--hamsa-body-line);

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


/* =========================================================
   MEDIA
   ========================================================= */

img,
svg,
video,
iframe {
    max-width: 100%;
}

img {
    height: auto;
    vertical-align: middle;
}

figure {
    margin: 0;
}


/* =========================================================
   GLOBAL LINKS
   ========================================================= */

a {
    color: var(--hamsa-black);

    text-decoration: none;

    transition:
        color .2s ease,
        background-color .2s ease,
        border-color .2s ease;
}

a:hover {
    color: var(--hamsa-gold-dark);
}

a:focus-visible {
    outline: 2px solid var(--hamsa-gold);
    outline-offset: 3px;
}


/* =========================================================
   CONTAINERS
   ========================================================= */

.hamsa-container {
    width: min(
        var(--hamsa-container),
        calc(100% - 48px)
    );

    margin-left: auto;
    margin-right: auto;
}

.hamsa-content-container {
    width: min(
        var(--hamsa-content),
        100%
    );

    margin-left: auto;
    margin-right: auto;
}

.hamsa-full-width {
    width: 100%;
    max-width: 100%;
}


/* =========================================================
   MAIN SITE AREAS
   ========================================================= */

.site {
    width: 100%;
    min-height: 100vh;
}

.hamsa-main {
    width: 100%;
}

.hamsa-content-area {
    width: 100%;
}

.hamsa-main-content {
    width: 100%;
    min-width: 0;
}


/* =========================================================
   CONTENT LAYOUTS
   ========================================================= */

.hamsa-content-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    padding-top: 24px;
    padding-bottom: 36px;
}

.hamsa-content-area.left-sidebar,
.hamsa-content-area.right-sidebar {
    grid-template-columns: minmax(0, 1fr) 300px;
}

.hamsa-content-area.left-sidebar {
    grid-template-areas: "sidebar content";
}

.hamsa-content-area.right-sidebar {
    grid-template-areas: "content sidebar";
}

.hamsa-content-area.no-sidebar {
    grid-template-areas: "content";
}

.hamsa-main-content {
    grid-area: content;
}

.hamsa-content-area > .hamsa-sidebar {
    grid-area: sidebar;
    min-width: 0;
}

.hamsa-entry {
    width: 100%;
}

@media (max-width: 991px) {
    .hamsa-content-area.left-sidebar,
    .hamsa-content-area.right-sidebar {
        grid-template-columns: 1fr;
        grid-template-areas: "content" "sidebar";
        gap: 32px;
    }
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */

body,
button,
input,
select,
textarea {
    font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
}


h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;

    color: var(--hamsa-black);

    font-weight: 700;

    text-wrap: balance;
}

h1 {
    margin-bottom: 20px;

    font-size: var(--hamsa-h1);
    line-height: 1.2;
}

h2 {
    margin-bottom: 18px;

    font-size: var(--hamsa-h2);
    line-height: 1.25;
}

h3 {
    margin-bottom: 16px;

    font-size: var(--hamsa-h3);
    line-height: 1.3;
}

h4 {
    margin-bottom: 14px;

    font-size: 19px;
    line-height: 1.35;
}

h5 {
    margin-bottom: 12px;

    font-size: 17px;
    line-height: 1.4;
}

h6 {
    margin-bottom: 10px;

    font-size: 15px;
    line-height: 1.4;
}

p {
    margin-top: 0;
    margin-bottom: 18px;
}

small {
    font-size: var(--hamsa-small-size);
}

strong,
b {
    font-weight: 700;
}


/* =========================================================
   CONTENT TYPOGRAPHY
   ========================================================= */

.entry-content,
.hamsa-entry-content {
    color: var(--hamsa-text);
}

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

.entry-content p,
.hamsa-entry-content p {
    max-width: 100%;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.hamsa-entry-content h1,
.hamsa-entry-content h2,
.hamsa-entry-content h3,
.hamsa-entry-content h4,
.hamsa-entry-content h5,
.hamsa-entry-content h6 {
    color: var(--hamsa-black);
}


/* =========================================================
   LISTS
   ========================================================= */

ul,
ol {
    margin-top: 0;
    margin-bottom: 20px;

    padding-left: 24px;
}

li {
    margin-bottom: 7px;
}


/* =========================================================
   HORIZONTAL RULE
   ========================================================= */

hr {
    height: 1px;

    margin: 32px 0;

    border: 0;

    background: var(--hamsa-gray-200);
}


/* =========================================================
   BLOCKQUOTES
   ========================================================= */

blockquote {
    margin: 28px 0;

    padding: 18px 22px;

    border-left: 3px solid var(--hamsa-gold);

    background: var(--hamsa-gray-50);

    color: var(--hamsa-gray-700);
}

blockquote p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   TABLES
   ========================================================= */

table {
    width: 100%;

    margin: 24px 0;

    border-collapse: collapse;

    font-size: 15px;
}

th,
td {
    padding: 12px 14px;

    border: 1px solid var(--hamsa-gray-200);

    text-align: left;
    vertical-align: top;
}

th {
    background: var(--hamsa-gray-100);

    color: var(--hamsa-black);

    font-weight: 700;
}


/* =========================================================
   BUTTON FOUNDATION
   ========================================================= */

button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    font: inherit;

    cursor: pointer;
}

.hamsa-button,
.wp-block-button__link {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding: 11px 24px;

    border: 1px solid var(--hamsa-gold);

    border-radius: 3px;

    background: var(--hamsa-gold);
    color: var(--hamsa-black);

    font-size: 15px;
    font-weight: 700;

    line-height: 1.2;

    text-decoration: none;

    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease;
}

.hamsa-button:hover,
.wp-block-button__link:hover {
    background: var(--hamsa-black);
    border-color: var(--hamsa-black);

    color: var(--hamsa-white);
}


/* =========================================================
   SECONDARY BUTTON
   ========================================================= */

.hamsa-button-secondary {
    background: var(--hamsa-white);
    border-color: var(--hamsa-black);

    color: var(--hamsa-black);
}

.hamsa-button-secondary:hover {
    background: var(--hamsa-black);
    border-color: var(--hamsa-black);

    color: var(--hamsa-white);
}


/* =========================================================
   FORMS
   ========================================================= */

input,
select,
textarea {
    width: 100%;

    max-width: 100%;

    padding: 11px 13px;

    border: 1px solid var(--hamsa-gray-300);
    border-radius: 2px;

    background: var(--hamsa-white);
    color: var(--hamsa-text);

    font: inherit;

    line-height: 1.5;
}

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

    border-color: var(--hamsa-gold);

    box-shadow:
        0 0 0 1px var(--hamsa-gold);
}

textarea {
    min-height: 140px;

    resize: vertical;
}

label {
    display: block;

    margin-bottom: 7px;

    color: var(--hamsa-black);

    font-size: 15px;
    font-weight: 600;
}


/* =========================================================
   WORDPRESS MEDIA
   ========================================================= */

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

.wp-caption-text {
    margin-top: 8px;

    color: var(--hamsa-muted);

    font-size: 14px;
    line-height: 1.5;
}


/* =========================================================
   WORDPRESS BLOCKS
   ========================================================= */

.wp-block-image {
    margin-top: 0;
    margin-bottom: 28px;
}

.wp-block-image img {
    max-width: 100%;
    height: auto;
}

.wp-block-separator {
    border: 0;

    height: 1px;

    background: var(--hamsa-gray-200);
}

.wp-block-group,
.wp-block-columns {
    max-width: 100%;
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.screen-reader-text {
    position: absolute !important;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}

:focus-visible {
    outline: 2px solid var(--hamsa-gold);
    outline-offset: 3px;
}


/* =========================================================
   SELECTION
   ========================================================= */

::selection {
    background: var(--hamsa-gold);
    color: var(--hamsa-black);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 991px) {

    :root {
        --hamsa-section-space: 56px;
    }

    .hamsa-container {
        width: calc(100% - 40px);
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    :root {
        --hamsa-section-space: 48px;
        --hamsa-body-size: 17px;
    }

    .hamsa-container {
        width: calc(100% - 32px);
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 21px;
    }

    h4 {
        font-size: 18px;
    }

    table {
        display: block;

        overflow-x: auto;

        -webkit-overflow-scrolling: touch;
    }

    th,
    td {
        white-space: nowrap;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .hamsa-container {
        width: calc(100% - 28px);
    }

    h1 {
        font-size: 27px;
    }

    h2 {
        font-size: 23px;
    }

    h3 {
        font-size: 20px;
    }

    p,
    li {
        line-height: 1.65;
    }

    .hamsa-button,
    .wp-block-button__link {
        min-height: 44px;

        padding-left: 20px;
        padding-right: 20px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

/* =========================================================
   404 / SYSTEM STATES
   ========================================================= */

.hamsa-404 {
    min-height: 56vh;
    display: flex;
    align-items: center;
    padding: 80px 0;
    background: #f7f7f5;
}

.hamsa-404-inner {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.hamsa-404-code {
    margin: 0 0 12px;
    color: var(--hamsa-gold-dark);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .18em;
}

.hamsa-404 h1 {
    margin: 0 0 18px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.1;
    color: var(--hamsa-black);
}

.hamsa-404-inner > p:not(.hamsa-404-code) {
    max-width: 600px;
    margin: 0 auto 30px;
    color: var(--hamsa-muted);
}

.hamsa-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    background: var(--hamsa-black);
    color: var(--hamsa-white);
    font-weight: 600;
}

.hamsa-button:hover,
.hamsa-button:focus {
    background: var(--hamsa-gold-dark);
    color: var(--hamsa-white);
}
