@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #004170;
    --primary-color-dark: #002d4f;
    --secondary-color: #850614;
    --secondary-color-dark: #5f030d;
    --text-main: #1c2433;
    --text-muted: #6d6272;
    --page-background: #f8fafc;
    --card-background: #ffffff;
    --line: rgba(28, 36, 51, 0.08);
    --shadow-soft: 0 10px 25px -5px rgba(0, 65, 112, 0.05), 0 8px 10px -6px rgba(0, 65, 112, 0.05);
    --radius-lg: 12px;
    --radius-md: 8px;
    --font-sans: "Instrument Sans", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--page-background);
    line-height: 1.5;
}

/* Header & Nav */
header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand::before {
    content: "⚫️";
    font-size: 1.1rem;
}

header nav {
    display: flex;
    gap: 24px;
}

header nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

header nav a:hover {
    color: var(--primary-color);
}

header nav a.is-active {
    color: var(--primary-color);
    border-bottom-color: var(--secondary-color);
}

/* Layout */
main {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 24px 0;
}

/* Buttons */
.button, button[type="submit"] {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.button:hover, button[type="submit"]:hover {
    background-color: var(--primary-color-dark);
}

.button-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.button-secondary:hover {
    background-color: rgba(0, 65, 112, 0.05);
}

/* Home Page */
#front-home-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 700px;
}

#front-home-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

#front-home-blocks article {
    background: var(--card-background);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#front-home-blocks article h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

#front-home-blocks article p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.home-actions {
    margin-top: 32px;
}

/* Search Form */
#front-offer-search {
    background: var(--card-background);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    box-shadow: var(--shadow-soft);
}

#front-offer-search label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex: 1 1 200px;
}

#front-offer-search input,
#front-offer-search select {
    height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: #ffffff;
    width: 100%;
}

#front-offer-search input:focus,
#front-offer-search select:focus {
    outline: none;
    border-color: var(--primary-color);
}

#front-offer-search button {
    height: 40px;
    padding: 0 24px;
}

/* Offer List */
#front-offer-list {
    display: grid;
    gap: 20px;
}

#front-offer-list article {
    background: var(--card-background);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

#front-offer-list article:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 65, 112, 0.2);
}

#front-offer-list article h2 {
    font-size: 1.35rem;
    margin: 0;
}

#front-offer-list article h2 a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

#front-offer-list article h2 a:hover {
    color: var(--secondary-color);
}

#front-offer-list article .meta {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

#front-offer-list article .desc {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.4);
}

/* Offer Show */
.back-link-wrap {
    margin-bottom: 24px;
}

.back-link-wrap a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.back-link-wrap a::before {
    content: "←";
}

.back-link-wrap a:hover {
    color: var(--primary-color);
}

#front-offer {
    background: var(--card-background);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-soft);
}

#front-offer h1 {
    font-size: 2.25rem;
    margin-bottom: 8px;
}

#front-offer .meta {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 32px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

#front-offer h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 24px 0 12px 0;
}

#front-offer p {
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 0 20px 0;
    white-space: pre-line;
}

/* Iframe / Preview Mode Overrides */
.is-iframe header {
    display: none;
}

.is-iframe main {
    margin: 10px auto;
    padding: 0 10px;
}

.is-iframe .back-link-wrap {
    display: none;
}
