/* ============================================================
   APACHE INSTITUTE OF ASTRONOMY — STYLESHEET

   EDITING GUIDE
   01  Colors and site dimensions
   02  Shared layout, typography and navigation
   03  Images, tables, forms and service cards
   04  Astrophotography gallery and lightbox
   05  Property panorama and rotating slideshows
   06  Home and About wallpapers
   07  Homepage facts (12 items, 6 across on desktop)
   08  Responsive rules

   This file replaces styles.css in full. Do not append it.
   ============================================================ */

/* 01 — COLORS AND SITE DIMENSIONS ============================ */
:root {
    --bg: #111719;
    --panel: #192225;
    --ink: #eef0ec;
    --muted: #b3bdbb;
    --accent: #c8aa80;
    --line: #384345;
    --max: 1200px;

    /* EDIT: wallpaper darkness, from 0 (clear) to 1 (black) */
    --wallpaper-overlay-top: 0.48;
    --wallpaper-overlay-bottom: 0.68;
}

/* 02 — SHARED LAYOUT AND TYPE ================================ */
* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.65 system-ui, sans-serif;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.wrap {
    width: min(var(--max), calc(100% - 48px));
    margin: auto;
}

header { border-bottom: 1px solid var(--line); }

.head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 23px 0;
}

.brand {
    text-decoration: none;
    font-weight: 650;
    letter-spacing: .06em;
    line-height: 1.25;
    font-size: 15px;
}

.brand span {
    display: block;
    font-size: 11px;
    letter-spacing: .18em;
    color: var(--muted);
    margin-top: 4px;
}

nav { display: flex; gap: 22px; flex-wrap: wrap; }
nav a { text-decoration: none; font-size: 14px; color: var(--muted); }
nav a:hover,
nav a[aria-current] { color: var(--ink); }

h1, h2, h3 {
    line-height: 1.15;
    font-weight: 500;
    letter-spacing: -.025em;
}

h1 { font-size: clamp(40px, 6vw, 74px); margin: 18px 0 20px; }
h2 { font-size: clamp(26px, 4vw, 42px); margin: 0 0 20px; }
h3 { font-size: 23px; margin: 0 0 12px; }
p { margin: 0 0 18px; color: var(--muted); }

.eyebrow {
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
}

.button {
    display: inline-block;
    padding: 12px 20px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.button.secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 25px;
}

.textlink { color: var(--accent); text-underline-offset: 4px; }

.hero {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 48px;
    align-items: center;
    padding: 75px 0;
}

.hero p { font-size: 18px; max-width: 560px; }

.intro { max-width: 770px; padding: 65px 0 25px; }
.intro h1 { font-size: clamp(38px, 5vw, 60px); }

section { padding: 55px 0; border-bottom: 1px solid var(--line); }

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

footer { padding: 35px 0; color: var(--muted); font-size: 13px; }
.foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* 03 — IMAGES, CARDS, TABLES AND FORMS ======================== */
.photo { margin: 0; }

.photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.photo figcaption { font-size: 12px; color: var(--muted); margin-top: 8px; }

.placeholder {
    min-height: 230px;
    aspect-ratio: 4 / 3;
    display: grid;
    place-content: center;
    text-align: center;
    border: 1px dashed #526062;
    background: var(--panel);
    padding: 25px;
    color: var(--muted);
}

.placeholder strong { color: var(--ink); font-weight: 500; }
.placeholder small { display: block; margin-top: 8px; overflow-wrap: anywhere; }

/* Base facts styling; homepage layout is in section 07. */
.facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 25px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.facts strong { display: block; font-size: 23px; font-weight: 500; }
.facts span { font-size: 12px; color: var(--muted); }

.services {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}

.services article { border-top: 1px solid var(--line); padding-top: 24px; }
.services .photo { margin-bottom: 25px; }

.specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td {
    text-align: left;
    padding: 15px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.specs th { width: 36%; font-weight: 500; }
.specs td { color: var(--muted); }

.note { border-left: 2px solid var(--accent); padding-left: 18px; }
.timeline article { padding: 20px 0; border-top: 1px solid var(--line); }

form { max-width: 750px; }
label { display: block; margin: 16px 0 5px; font-size: 14px; }
input, select, textarea {
    width: 100%;
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--line);
    padding: 12px;
    font: inherit;
    border-radius: 0;
}
textarea { min-height: 140px; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.status { color: var(--accent); margin-top: 15px; }

/* 04 — ASTROPHOTOGRAPHY GALLERY AND LIGHTBOX ================== */
/* EDIT: desktop gallery count = 4 */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin: 24px 0 0;
}

.gallery article {
    min-width: 0;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

.gallery .photo { margin: 0; }
.gallery-link {
    display: block;
    cursor: zoom-in;
    text-decoration: none;
    overflow: hidden;
    background: #080c0e;
}
.gallery-link img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain; /* Preserve full astrophotography field */
}
.gallery-link:hover img { opacity: .9; }
.gallery-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.gallery .placeholder { aspect-ratio: 4 / 3; min-height: 0; }
.gallery h3 { font-size: 17px; line-height: 1.35; margin: 13px 0 0; }
.gallery .photo figcaption { margin-top: 10px; line-height: 1.5; }
.gallery-intro { max-width: 850px; margin: 28px auto 0; text-align: center; }

body.lightbox-open { overflow: hidden; }
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(3, 7, 9, .97);
    display: grid;
    place-items: center;
    padding: 18px;
}

.lightbox-panel {
    position: relative;
    width: min(1480px, 100%);
    height: min(95vh, 100%);
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 10px;
}

.lightbox-content {
    min-width: 0;
    min-height: 0;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.lightbox-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(95vh - 130px);
    object-fit: contain;
}
.lightbox-meta { width: 100%; max-width: 900px; margin: 14px auto 0; text-align: center; }
.lightbox-title { font-size: 19px; font-weight: 550; color: var(--ink); }
.lightbox-caption { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.5; }
.lightbox-bottom {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-top: 9px;
    font-size: 12px;
    color: var(--muted);
}
.lightbox-full { color: var(--accent); text-underline-offset: 3px; }
.lightbox-close, .lightbox-prev, .lightbox-next {
    background: transparent;
    border: 1px solid #465154;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
}
.lightbox-close {
    position: absolute;
    right: 0;
    top: 0;
    width: 38px;
    height: 38px;
    font-size: 26px;
    line-height: 1;
}
.lightbox-prev, .lightbox-next { width: 44px; height: 58px; font-size: 36px; line-height: 1; }
.lightbox-prev:hover, .lightbox-next:hover, .lightbox-close:hover { background: #243034; }
.lightbox button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 05 — PROPERTY PANORAMA AND ROTATING SLIDESHOWS ============= */
/* This selector matches the main static property image on site.html. */
section.split:has(img[src="images/property.jpg"]) {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: start;
}
section.split:has(img[src="images/property.jpg"]) .photo { width: 100%; margin: 0; }
section.split:has(img[src="images/property.jpg"]) .photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
}
section.split:has(img[src="images/property.jpg"]) > div { width: 100%; }

.slideshow {
    position: relative;
    width: 100%;
    min-width: 0;
    background: var(--panel);
    overflow: hidden;
}
.slideshow-slides { position: relative; width: 100%; aspect-ratio: 4 / 3; }
.slideshow .slide {
    position: absolute;
    inset: 0;
    margin: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.slideshow .slide.active { display: flex; }
.slideshow .slide img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center;
}
.slideshow .slide figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}
.slideshow-prev, .slideshow-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    z-index: 2;
}
.slideshow-prev { left: 8px; }
.slideshow-next { right: 8px; }
.slideshow-prev:hover, .slideshow-next:hover { background: rgba(0, 0, 0, .85); }
.slideshow-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 9px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 12px;
    z-index: 2;
}

/* Property and construction carousels on site.html */
.site-slideshow { width: 100%; max-width: 1000px; margin: 30px auto 0; }
.site-slideshow .slideshow-slides { aspect-ratio: 16 / 9; }


/* ============================================================
   06. PAGE WALLPAPERS

   Shared styling:
   - Homepage
   - About
   - Inquiry

   Each page has its own background photograph.
   ============================================================ */

/* SHARED WALLPAPER SETTINGS */

body.home-page,
body.about-page,
body.inquire-page {
    min-height: 100vh;

    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}


/* HOMEPAGE WALLPAPER */

body.home-page {
    background-image:
        linear-gradient(
            rgba(0, 0, 0, 0.18),
            rgba(0, 0, 0, 0.18)
        ),
        url("images/wallpaper.jpg");
}


/* ABOUT PAGE WALLPAPER */

body.about-page {
    background-image:
        linear-gradient(
            rgba(0, 0, 0, 0.18),
            rgba(0, 0, 0, 0.18)
        ),
        url("images/about-wallpaper.jpg");
}


/* INQUIRY PAGE WALLPAPER */

body.inquire-page {
    background-image:
        linear-gradient(
            rgba(0, 0, 0, 0.18),
            rgba(0, 0, 0, 0.18)
        ),
        url("images/inquire-wallpaper.jpg");
}


/* SHARED HEADER AND SECTION STYLING */

.home-page header,
.about-page header,
.inquire-page header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.home-page section,
.about-page section,
.inquire-page section {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}


/* SHARED FOOTER */

.home-page footer,
.about-page footer,
.inquire-page footer {
    background: rgba(0, 0, 0, 0.25);
}


/* MOBILE BROWSER COMPATIBILITY */

@media (max-width: 760px) {

    body.home-page,
    body.about-page,
    body.inquire-page {
        background-attachment: scroll;
    }

}


/* ============================================================
   INQUIRY PAGE - FORM READABILITY
   ============================================================ */

/* Keep the form readable over the wallpaper */

.inquire-page form {
    background: rgba(17, 23, 25, 0.78);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Mobile form spacing */

@media (max-width: 600px) {

    .inquire-page form {
        padding: 18px;
    }

}


/* 07 — HOMEPAGE FACTS ======================================== */
/* EDIT: width = 1500px; columns = 6; keep LEFT edge aligned */
.home-page .facts {
    display: grid;
    width: min(1500px, calc(100vw - 120px));
    max-width: none;
    position: relative;
    left: 0;
    transform: none;
    margin-left: 0;
    margin-right: 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 35px 24px;
    padding: 35px 25px;
    background: rgba(0, 0, 0, .25);
}
.home-page .facts > div { min-width: 0; }
.home-page .facts strong {
    display: block;
    font-size: clamp(16px, 1.4vw, 22px);
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 8px;
}
.home-page .facts span { display: block; font-size: 12px; line-height: 1.5; }
.home-page .facts .fact-detail { margin-top: 8px; opacity: .8; }

/* 08 — RESPONSIVE RULES ====================================== */
@media (max-width: 1100px) {
    .home-page .facts {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .wrap { width: calc(100% - 32px); }
    .head { align-items: flex-start; flex-direction: column; gap: 16px; }
    nav { gap: 12px 19px; }
    .hero, .split, .services { grid-template-columns: 1fr; gap: 25px; }
    .hero { padding: 40px 0; }
    .facts { grid-template-columns: repeat(2, 1fr); }
    section { padding: 35px 0; }
    .formgrid { grid-template-columns: 1fr; }
    .intro { padding-top: 35px; }
    section.split:has(img[src="images/property.jpg"]) { gap: 25px; }

    .home-page .hero { min-height: 65vh; padding: 60px 0; }
    body.home-page, body.about-page { background-attachment: scroll; }
}

@media (max-width: 700px) {
    .home-page .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lightbox { padding: 8px; }
    .lightbox-panel { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 2px; }
    .lightbox-prev, .lightbox-next { width: 32px; height: 48px; font-size: 27px; }
    .lightbox-close { right: 4px; top: 5px; z-index: 2; }
    .lightbox-image { max-height: calc(95vh - 180px); }
    .lightbox-title { font-size: 16px; }
    .lightbox-caption { font-size: 12px; }
}

@media (max-width: 600px) {
    .gallery { grid-template-columns: 1fr; gap: 28px; }
    .slideshow-prev, .slideshow-next { width: 30px; height: 42px; font-size: 18px; }
    .slideshow .slide figcaption { font-size: 11px; padding: 8px 12px; }
    .site-slideshow { margin-top: 20px; }
}

@media (max-width: 420px) {
    .home-page .facts { grid-template-columns: 1fr; }
}
