body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
}
header {
    background-color: #333;
    color: #fff;
    padding: 20px;
    text-align: center;
}
nav {
    background-color: #444;
    overflow: hidden;
}
nav a {
    float: left;
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}
nav a:hover {
    background-color: #575757;
    color: white;
}
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}
.search-bar {
    margin: 20px 0;
    text-align: center;
}
.search-bar input[type="text"] {
    width: 60%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
}
.search-bar button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    background-color: #333;
    color: #fff;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: #fff;
    margin-top: 40px;
}
/* 공지 박스: 내용에 따라 유동적으로 폭 조절 */
.announcement-card {
    position: fixed;
    top: 90px;
    left: 20px;                 /* 페이지 왼쪽 정렬 기준 */
    right: auto;
    background: #fffbea;
    border: 1px solid #ffeb3b;
    border-radius: 8px;
    padding: 10px 12px;         /* 여백을 조금 줄임 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 1000;
    text-align: left;
    box-sizing: border-box;

    /* 핵심: 내용 기반으로 유동 폭, 화면 크기에 따라 최대/최소 제한 */
    width: auto;                                /* 내용 기반으로 너비 결정 */
    max-width: clamp(280px, 48vw, 720px);       /* 최소 280px, 권장 48vw, 최대 720px */
    min-width: 220px;                           /* 너무 작아지지 않도록 최소값 */
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

/* 제목/본문/버튼 스타일 (기존과 유사) */
.announcement-card h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    line-height: 1.2;
}

.announcement-card .announcement-content {
    white-space: pre-wrap;   /* 줄바꿈 보존 */
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

/* 버튼: 내용 기반 너비, 박스에 딱 맞게 (원하면 width:100% 로 전체폭으로 변경) */
.announcement-card .announcement-dismiss {
    display: inline-block;
    width: auto;                  /* 내용 길이에 맞춤 */
    font-size: 14px;
    padding: 8px 12px;
    margin-top: 6px;
    background: linear-gradient(#ffec3d, #ffd600);
    border: 1px solid #f7c600;
    color: #222;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    text-align: center;
    align-self: center;
}

/* hover 효과 */
.announcement-card .announcement-dismiss:hover {
    background: linear-gradient(#ffd600, #ffcf00);
}

.lunch-wrapper {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.lunch-card {
    flex: 1 1 250px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    min-width: 220px;
    max-width: 300px;
        }

.lunch-card h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
    text-align: center;
    }

.lunch-card pre {
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 14px;
    }
.vote-buttons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.vote-buttons button {
    font-size: 18px;
    cursor: pointer;
    }
.vote-result {
    font-size: 14px;
    margin-left: 10px;
    font-weight: bold;
}

.post-image {
  max-width: 600px;      /* PC에서 제한 */
  width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
}

.post-list {
    max-width: 800px;   /* 게시판 폭 제한 */
    margin: 0 auto;     /* 화면 가운데 배치 */
    padding: 20px;
}

.post-item {
    text-align: left;         /* 왼쪽 정렬 */
    border-bottom: 1px solid #ccc;
    padding: 15px 20px;       /* 내부 여백: 좌우 20px */
    margin-bottom: 10px;      /* 게시글 사이 여백 */
    background-color: #fafafa;/* 약간 연한 배경 */
    border-radius: 6px;       /* 모서리 둥글게 */
}

.post-item h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
}

.post-item a {
    text-decoration: none;
    color: #3366cc;
}

.post-item a:hover {
    text-decoration: underline;
}

.post-item p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* 컨테이너 */
.post-form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* 제목 */
.form-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

/* 에러 메시지 */
.form-error {
    color: red;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}

/* 그룹 */
.form-group {
    margin-bottom: 20px;
}

/* 라벨 */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
}

/* 입력창 */
.form-group input[type="text"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #444;
    outline: none;
}

/* 버튼 */
.submit-btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    background-color: #444;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.guest-message {
    text-align: center;
}

.submit-btn:hover {
    background-color: #444;
}

 .form-error { color:#b00; background:#fee; padding:10px; border-radius:6px; }
        .form-group { margin-bottom:12px; }
        .form-group label { font-weight:bold; display:block; margin-bottom:4px; }
        .post-form input[type="text"],
        .post-form textarea,
        .post-form input[type="file"] {
            width:100%;
            padding:8px;
            border:1px solid #ccc;
            border-radius:4px;
        }
        .submit-btn {
            padding:10px 16px;
            background:#333;
            color:#fff;
            border:none;
            border-radius:6px;
            cursor:pointer;
        }
        .submit-btn:hover {
            background:#555;
        }
@media (max-width: 768px) {
  nav a {
    float: none;
    display: block;
    text-align: center;
    padding: 10px;
  }

  .container {
    padding: 10px;
    width: 100%;
  }

  .search-bar input[type="text"] {
    width: 80%;
    font-size: 14px;
  }

  .search-bar button {
    font-size: 14px;
    padding: 8px 12px;
  }

  .lunch-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .lunch-card {
    max-width: 90%;
  }


  .vote-buttons {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .vote-buttons button {
    font-size: 16px;
  }

  .vote-result {
    font-size: 13px;
    margin-left: 0;
  }


  .post-image {
    max-width: 90%;      /* 모바일 화면에서 더 줄이기 */
  }

    .post-form-container {
        margin: 20px 10px;       /* 좌우 여백 최소화 */
        padding: 20px;           /* 내부 패딩 축소 */
    }

    .form-title {
        font-size: 20px;         /* 제목 크기 축소 */
    }

    .form-group input[type="text"],
    .form-group input[type="file"],
    .form-group textarea {
        padding: 10px;           /* 입력칸 패딩 축소 */
        font-size: 14px;         /* 글씨 크기 축소 */
    }

    .submit-btn {
        padding: 12px;           /* 버튼 높이 축소 */
        font-size: 15px;         /* 버튼 글씨 축소 */
    }

 .announcement-card {
        left: 10px;
        top: 70px;
        max-width: calc(100% - 20px);
        min-width: 180px;
        padding: 10px;
    }
    .announcement-card h3 { font-size: 16px; }
    .announcement-card .announcement-dismiss { padding: 8px 10px; font-size: 14px; align-self: center;}

    .post-form-container {
        margin: 16px auto;
        padding: 0 12px;
    }

    .form-title {
        font-size: 20px;
        text-align: center;
    }

    .post-form .form-group label {
        font-size: 14px;
    }

    .post-form input[type="text"],
    .post-form textarea,
    .post-form input[type="file"] {
        font-size: 14px;
        padding: 10px;
    }

    textarea {
        min-height: 150px;
    }

    .submit-btn {
        display: block;
        width: 100%;
        font-size: 15px;
        padding: 12px;
        margin-top: 10px;
    }

    /* 에러 메시지도 모바일 최적화 */
    .form-error {
        font-size: 14px;
        padding: 8px;
        margin-bottom: 12px;
        text-align: center;
    }
    }